Revise IdList::Tag to reduce code duplication. NFC.

This commit is contained in:
Ryan Pavlik 2019-05-22 16:01:35 -05:00 committed by whitequark
parent 5ada4dbd9c
commit 0c941aedb1

View File

@ -452,11 +452,9 @@ public:
} }
void Tag(H h, int tag) { void Tag(H h, int tag) {
int i; auto it = FindByIdNoOops(h);
for(i = 0; i < n; i++) { if (it != nullptr) {
if(elem[i].h.v == h.v) { it->tag = tag;
elem[i].tag = tag;
}
} }
} }