Skip to content

PdbInternalSectionOffset should derive Ord #138

@mstange

Description

@mstange

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions