Commit d24c1428 authored by Alex Henrie's avatar Alex Henrie

Simplify UrnSampler::sample

parent 9c3246a4
......@@ -60,10 +60,9 @@ public:
}
else
{
std::swap(_urn[i], _urn.back());
_temp = _urn.back();
_urn.pop_back();
return _temp;
Value temp = _urn[i];
_urn.erase(_urn.begin() + i);
return temp;
}
}
......@@ -73,7 +72,6 @@ public:
private:
vector<Value> _urn;
Value _temp;
};
} // namespace graph_tool
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment