@@ -4340,17 +4340,13 @@ void RewriteModernObjC::SynthesizeBlockLiterals(SourceLocation FunLocStart,
4340
4340
ValueDecl *VD = Exp->getDecl ();
4341
4341
BlockDeclRefs.push_back (Exp);
4342
4342
if (!VD->hasAttr <BlocksAttr>()) {
4343
- if (!BlockByCopyDeclsPtrSet.count (VD)) {
4344
- BlockByCopyDeclsPtrSet.insert (VD);
4343
+ if (BlockByCopyDeclsPtrSet.insert (VD).second )
4345
4344
BlockByCopyDecls.push_back (VD);
4346
- }
4347
4345
continue ;
4348
4346
}
4349
4347
4350
- if (!BlockByRefDeclsPtrSet.count (VD)) {
4351
- BlockByRefDeclsPtrSet.insert (VD);
4348
+ if (BlockByRefDeclsPtrSet.insert (VD).second )
4352
4349
BlockByRefDecls.push_back (VD);
4353
- }
4354
4350
4355
4351
// imported objects in the inner blocks not used in the outer
4356
4352
// blocks must be copied/disposed in the outer block as well.
@@ -5161,18 +5157,14 @@ void RewriteModernObjC::CollectBlockDeclRefInfo(BlockExpr *Exp) {
5161
5157
// Unique all "by copy" declarations.
5162
5158
for (unsigned i = 0 ; i < BlockDeclRefs.size (); i++)
5163
5159
if (!BlockDeclRefs[i]->getDecl ()->hasAttr <BlocksAttr>()) {
5164
- if (!BlockByCopyDeclsPtrSet.count (BlockDeclRefs[i]->getDecl ())) {
5165
- BlockByCopyDeclsPtrSet.insert (BlockDeclRefs[i]->getDecl ());
5160
+ if (BlockByCopyDeclsPtrSet.insert (BlockDeclRefs[i]->getDecl ()).second )
5166
5161
BlockByCopyDecls.push_back (BlockDeclRefs[i]->getDecl ());
5167
- }
5168
5162
}
5169
5163
// Unique all "by ref" declarations.
5170
5164
for (unsigned i = 0 ; i < BlockDeclRefs.size (); i++)
5171
5165
if (BlockDeclRefs[i]->getDecl ()->hasAttr <BlocksAttr>()) {
5172
- if (!BlockByRefDeclsPtrSet.count (BlockDeclRefs[i]->getDecl ())) {
5173
- BlockByRefDeclsPtrSet.insert (BlockDeclRefs[i]->getDecl ());
5166
+ if (BlockByRefDeclsPtrSet.insert (BlockDeclRefs[i]->getDecl ()).second )
5174
5167
BlockByRefDecls.push_back (BlockDeclRefs[i]->getDecl ());
5175
- }
5176
5168
}
5177
5169
// Find any imported blocks...they will need special attention.
5178
5170
for (unsigned i = 0 ; i < BlockDeclRefs.size (); i++)
0 commit comments