Remove unnecessary constraint from Range subpiece constructor
authorGiuseppe Ottaviano <ott@fb.com>
Fri, 19 Dec 2014 17:50:57 +0000 (09:50 -0800)
committerDave Watson <davejwatson@fb.com>
Mon, 29 Dec 2014 18:39:47 +0000 (10:39 -0800)
commit0b028d4ae1effbaf275b99d6bf0608429d9d4434
tree1114c404cb20cd4ed483164343912880ac3a656f
parent580fc806714dc70c505a583c84f84d3e0105d036
Remove unnecessary constraint from Range subpiece constructor

Summary:
D1746899 enforced the constraint (previously in a comment) on the
constructor `Range(const Range&, size_t, size_t)` that `Iter` is a
`const char*`. There is however no reason for this constraint.

This patch generalizes and simplifies the constructor, and since it
has the same semantics as `subpiece`, the latter is implemented in
terms of the constructor.

Test Plan:
fbconfig -r folly && fbmake runtests_opt

Reviewed By: soren@fb.com

Subscribers: trunkagent, folly-diffs@

FB internal diff: D1747958

Signature: t1:1747958:1418930360:fcd6beeda34e64ec8a34b9491a57674ae2265596
folly/Range.h
folly/test/RangeTest.cpp