summaryrefslogtreecommitdiff
path: root/src/emscripten-optimizer/istring.h
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2019-05-01 14:48:41 -0700
committerGitHub <noreply@github.com>2019-05-01 14:48:41 -0700
commit2bd3758a22131cfd6925b3fd995657b211095c90 (patch)
tree2a38a48ab68c00ed1b55e885f86014bbdda92ff2 /src/emscripten-optimizer/istring.h
parent73709b4da08d285c2237c8c23a54ba53274c0c7f (diff)
downloadbinaryen-2bd3758a22131cfd6925b3fd995657b211095c90.tar.gz
binaryen-2bd3758a22131cfd6925b3fd995657b211095c90.tar.bz2
binaryen-2bd3758a22131cfd6925b3fd995657b211095c90.zip
clang-tidy braces changes (#2075)
Applies the changes in #2065, and temprarily disables the hook since it's too slow to run on a change this large. We should re-enable it in a later commit.
Diffstat (limited to 'src/emscripten-optimizer/istring.h')
-rw-r--r--src/emscripten-optimizer/istring.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/emscripten-optimizer/istring.h b/src/emscripten-optimizer/istring.h
index 320a3e590..21f94fcb9 100644
--- a/src/emscripten-optimizer/istring.h
+++ b/src/emscripten-optimizer/istring.h
@@ -136,12 +136,15 @@ struct IString {
const char* stripPrefix(const char* prefix) const {
const char* ptr = str;
while (true) {
- if (*prefix == 0)
+ if (*prefix == 0) {
return ptr;
- if (*ptr == 0)
+ }
+ if (*ptr == 0) {
return nullptr;
- if (*ptr++ != *prefix++)
+ }
+ if (*ptr++ != *prefix++) {
return nullptr;
+ }
}
}
@@ -191,11 +194,13 @@ public:
strncpy(curr, init, size);
while (1) {
char* end = strchr(curr, ' ');
- if (end)
+ if (end) {
*end = 0;
+ }
insert(curr);
- if (!end)
+ if (!end) {
break;
+ }
curr = end + 1;
}
}