Simplify range check in VA_Slice
Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/24ab8ec6 Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/24ab8ec6 Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/24ab8ec6 Branch: refs/heads/master Commit: 24ab8ec602e6b5085cad56ea10809727e8bb8929 Parents: ed096ff Author: Nick Wellnhofer <[email protected]> Authored: Thu Apr 23 14:35:57 2015 +0200 Committer: Nick Wellnhofer <[email protected]> Committed: Thu Apr 23 14:35:57 2015 +0200 ---------------------------------------------------------------------- runtime/core/Clownfish/VArray.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/24ab8ec6/runtime/core/Clownfish/VArray.c ---------------------------------------------------------------------- diff --git a/runtime/core/Clownfish/VArray.c b/runtime/core/Clownfish/VArray.c index 294e342..690f441 100644 --- a/runtime/core/Clownfish/VArray.c +++ b/runtime/core/Clownfish/VArray.c @@ -293,9 +293,7 @@ VA_Slice_IMP(VArray *self, size_t offset, size_t length) { offset = 0; length = 0; } - else if (length > SIZE_MAX - offset - || offset + length > self->size - ) { + else if (length > self->size - offset) { length = self->size - offset; }
