pdb icon indicating copy to clipboard operation
pdb copied to clipboard

PdbInternalSectionOffset should derive Ord

Open mstange opened this issue 3 years ago • 0 comments

It would be nice to be able to binary search offsets, and to use them as keys in a BTreeMap.

Here's a spot in pdb-addr2line which would be improved by an implementation of Ord on PdbInternalSectionOffset: https://github.com/mstange/pdb-addr2line/blob/f6cd33ab2192c69da6d79f44087ab41bb39804aa/src/lib.rs#L1165-L1168

Here's another spot, and in this case the exact ordering actually makes a difference: https://github.com/mstange/pdb-addr2line/blob/f6cd33ab2192c69da6d79f44087ab41bb39804aa/src/lib.rs#L742-L756

We should order by section index first, and then by section-internal offset.

mstange avatar Jul 12 '22 22:07 mstange