summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/cstylecast.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'compilerplugins/clang/cstylecast.cxx')
-rw-r--r--compilerplugins/clang/cstylecast.cxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/compilerplugins/clang/cstylecast.cxx b/compilerplugins/clang/cstylecast.cxx
index 253f19ef651c..fe3b2a19c561 100644
--- a/compilerplugins/clang/cstylecast.cxx
+++ b/compilerplugins/clang/cstylecast.cxx
@@ -603,8 +603,7 @@ bool CStyleCast::rewriteArithmeticCast(CStyleCastExpr const * expr, char const *
secondBegin = l;
++secondLen;
}
- if (rewritten_.find(firstBegin) == rewritten_.end()) {
- rewritten_.insert(firstBegin);
+ if (rewritten_.insert(firstBegin).second) {
if (!replaceText(firstBegin, firstLen, functional ? "" : "static_cast<")) {
if (isDebugMode()) {
report(
@@ -630,8 +629,7 @@ bool CStyleCast::rewriteArithmeticCast(CStyleCastExpr const * expr, char const *
}
}
if (third.isValid()) {
- if (rewritten_.find(third) == rewritten_.end()) {
- rewritten_.insert(third);
+ if (rewritten_.insert(third).second) {
if (!insertTextBefore(third, "(")) {
//TODO: roll back
if (isDebugMode()) {