From 1dc38391fe5e016fd877126337ca97a971d97e77 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Thu, 3 May 2012 18:15:15 -0700 Subject: Reorder a few lines, no functionality (or perf) change. --- src/util.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/util.cc b/src/util.cc index dfae8d6..de535b3 100644 --- a/src/util.cc +++ b/src/util.cc @@ -138,18 +138,17 @@ bool CanonicalizePath(char* path, int* len, string* err) { continue; } - const char* sep = (const char*)memchr(src, '/', end - src); - if (sep == NULL) - sep = end; - if (component_count == kMaxPathComponents) Fatal("path has too many components"); components[component_count] = dst; ++component_count; + + const char* sep = (const char*)memchr(src, '/', end - src); + if (sep == NULL) + sep = end; while (src <= sep) { *dst++ = *src++; } - src = sep + 1; } -- cgit v0.12