diff options
| author | Philip Kelley <phkelley@hotmail.com> | 2013-01-29 16:49:12 -0500 |
|---|---|---|
| committer | Philip Kelley <phkelley@hotmail.com> | 2013-01-29 16:49:12 -0500 |
| commit | 590365db54e7f0311bd77d09270c7c3714a33b3c (patch) | |
| tree | dbc4bc3378b81ec1f5e3dd47ddea20ec4250f3bf /src/vector.c | |
| parent | 11d9f6b30438a141def883b0115f7f764c03e990 (diff) | |
| download | libgit2-590365db54e7f0311bd77d09270c7c3714a33b3c.tar.gz | |
Now with no multiply
Diffstat (limited to 'src/vector.c')
| -rw-r--r-- | src/vector.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/vector.c b/src/vector.c index 66842d4f1..f4a818ed2 100644 --- a/src/vector.c +++ b/src/vector.c @@ -20,8 +20,8 @@ GIT_INLINE(size_t) compute_new_size(git_vector *v) * instructions and less than the golden ratio (1.618...) */ if (new_size < MIN_ALLOCSIZE) new_size = MIN_ALLOCSIZE; - else if (new_size <= SIZE_MAX / 3) - new_size = new_size * 3 / 2 + 1; + else if (new_size <= (SIZE_MAX / 3) * 2) + new_size += new_size / 2; else new_size = SIZE_MAX; |
