[PATCH] D35278: Support: Add llvm::center_justify.
Rui Ueyama via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 11 16:08:41 PDT 2017
ruiu added inline comments.
================
Comment at: lib/Support/raw_ostream.cpp:344
+ case FormattedString::JustifyCenter: {
+ const int PadAmount = Difference / 2;
this->indent(PadAmount);
----------------
nit; since the scope of this variable is very small, I wouldn't add `const` as it is obvious.
================
Comment at: lib/Support/raw_ostream.cpp:347
+ this->operator<<(FS.Str);
+ this->indent(PadAmount + (Difference - (PadAmount * 2)));
+ } break;
----------------
PadAmount + (Difference - (PadAmount * 2))
is the same as
PadAmount + Difference - PadAmount * 2
and thus
Difference - PadAmount
?
================
Comment at: lib/Support/raw_ostream.cpp:348
+ this->indent(PadAmount + (Difference - (PadAmount * 2)));
+ } break;
+ default:
----------------
I believe we usually write this way.
break;
}
https://reviews.llvm.org/D35278
More information about the llvm-commits
mailing list