Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: solvespace/solvespace
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: b284e807857d
Choose a base ref
...
head repository: solvespace/solvespace
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 13820bf27d2c
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Aug 20, 2019

  1. Revert "IdList::RemoveTagged switch to std::remove_if from iteration.…

    … NFC."
    
    This reverts commit 0bb6a34.
    rpavlik authored and whitequark committed Aug 20, 2019

    Verified

    This commit was signed with the committer’s verified signature.
    Copy the full SHA
    13820bf View commit details
Showing with 15 additions and 13 deletions.
  1. +15 −13 src/dsc.h
28 changes: 15 additions & 13 deletions src/dsc.h
Original file line number Diff line number Diff line change
@@ -493,22 +493,24 @@ class IdList {
}

void RemoveTagged() {
auto newEnd = std::remove_if(this->begin(), this->end(), [](T &t) {
if(t.tag) {
t.Clear();
return true;
}
return false;
});
if(newEnd != this->end()) {
while (newEnd != this->end()) {
newEnd->~T();
++newEnd;
int src, dest;
dest = 0;
for(src = 0; src < n; src++) {
if(elem[src].tag) {
// this item should be deleted
elem[src].Clear();
} else {
if(src != dest) {
elem[dest] = elem[src];
}
dest++;
}
}
n = newEnd - begin();
for(int i = dest; i < n; i++)
elem[i].~T();
n = dest;
// and elemsAllocated is untouched, because we didn't resize
}

void RemoveById(H h) {
ClearTags();
FindById(h)->tag = 1;