Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#985 closed patch (fixed)

Replace sort to min_element in SubgraphDepthLocater::getDepth

Reported by: dkvash Owned by: dbaston
Priority: trivial Milestone:
Component: Default Version: main
Severity: Idea Keywords: SubgraphDepthLocater
Cc:

Description

SubgraphDepthLocater::getDepth uses heavy std::sort to find minimum DepthSegment, this patch replaces sort to a more appropriate std::min_element.

Origin implementation also relies on a Collections.min instead of heavy sort. https://github.com/locationtech/jts/blob/jts-1.16.1/modules/core/src/main/java/org/locationtech/jts/operation/buffer/SubgraphDepthLocater.java#L53

Attachments (1)

Substitute_std__sort_to_std__min_element.patch (730 bytes ) - added by dkvash 3 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 by dkvash, 3 years ago

Priority: majortrivial
Severity: UnassignedIdea

comment:2 by dbaston, 3 years ago

Owner: changed from geos-devel@… to dbaston

comment:3 by Daniel Baston <dbaston@…>, 3 years ago

Resolution: fixed
Status: newclosed

In bd66c5a/git:

Avoid unnecessary sort in SubgraphDepthLocater

Patch by dkvash
Fixes #985

comment:4 by dbaston, 3 years ago

Thanks!

Note: See TracTickets for help on using tickets.