diff options
author | Ben Smith <binjimin@gmail.com> | 2017-12-09 15:29:26 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-09 15:29:26 -0800 |
commit | 72e7fd34dc143f2ea0d5f134834e57a41b29ab77 (patch) | |
tree | 41a99ff8305952155106e5cde94f1e394c7ac4c7 /src/binary-writer-spec.cc | |
parent | a8306f4e1c2d995aab30514cac3219e449325469 (diff) | |
download | wabt-72e7fd34dc143f2ea0d5f134834e57a41b29ab77.tar.gz wabt-72e7fd34dc143f2ea0d5f134834e57a41b29ab77.tar.bz2 wabt-72e7fd34dc143f2ea0d5f134834e57a41b29ab77.zip |
[cleanup] Always use braces with if (#691)
Diffstat (limited to 'src/binary-writer-spec.cc')
-rw-r--r-- | src/binary-writer-spec.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/binary-writer-spec.cc b/src/binary-writer-spec.cc index 5e4f95ab..334945ba 100644 --- a/src/binary-writer-spec.cc +++ b/src/binary-writer-spec.cc @@ -142,10 +142,11 @@ void BinaryWriterSpec::WriteLocation(const Location& loc) { } void BinaryWriterSpec::WriteVar(const Var& var) { - if (var.is_index()) + if (var.is_index()) { json_stream_.Writef("\"%" PRIindex "\"", var.index()); - else + } else { WriteEscapedString(var.name()); + } } void BinaryWriterSpec::WriteTypeObject(Type type) { @@ -206,8 +207,9 @@ void BinaryWriterSpec::WriteConstVector(const ConstVector& consts) { for (size_t i = 0; i < consts.size(); ++i) { const Const& const_ = consts[i]; WriteConst(const_); - if (i != consts.size() - 1) + if (i != consts.size() - 1) { WriteSeparator(); + } } json_stream_.Writef("]"); } @@ -272,8 +274,9 @@ void BinaryWriterSpec::WriteModule(string_view filename, const Module& module) { MemoryStream memory_stream(spec_options_->log_stream); result_ = WriteBinaryModule(&memory_stream, &module, &spec_options_->write_binary_options); - if (Succeeded(result_) && write_modules_) + if (Succeeded(result_) && write_modules_) { result_ = memory_stream.WriteToFile(filename); + } } void BinaryWriterSpec::WriteScriptModule(string_view filename, |