Closed yakra closed 3 months ago
Nope.
foo ^ 1
toggles foo rather than simply clearing it.
For these uses cases, it would have to be guaranteed that the target bit is already 1.
Don't know offhand if that's the case, and I'm not going to delve that deep into the code to find out.
As this is already low priority for the reasons in the OP, simply closing this.
https://github.com/yakra/DataProcessing/blob/f86fadc9479d6ad91852c6c38d35f641b70ec6ef/siteupdate/cplusplus/classes/GraphGeneration/HighwayGraph.cpp#L194
https://github.com/yakra/DataProcessing/blob/f86fadc9479d6ad91852c6c38d35f641b70ec6ef/siteupdate/cplusplus/classes/GraphGeneration/HGEdge.cpp#L141
foo &= ~(bar)
->foo ^= bar;
Probably won't improve much. The compiler may even optimize it away. But it's The Right Thing To Do!Low priority though:
HGEdge::detach
may vanish once edges are moved into contiguous storage.