[openstreetmap/openstreetmap-website] Take entrances into account for routing start and end points (PR #7017)
Richard Fairhurst
notifications at github.com
Thu Apr 23 15:28:12 UTC 2026
@systemed commented on this pull request.
> +
+ let bestFind = types.length;
+ let result = null;
+
+ for (const e of entrances) {
+ const matchId = types.indexOf(e.type);
+ if (matchId === 0) return e;
+ if (matchId > 0 && matchId < bestFind) {
+ bestFind = matchId;
+ result = e;
+ }
+ }
+
+ return result;
I feel you should be using `find` with an arrow function here but hey ;)
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/7017?email_source=notifications&email_token=AAK2OLJ4BTIKSSHWRB3T5N34XIZAZA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTIMJWGM3TIOBQG42KM4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOS6XA4S7OJSXM2LFO5PW433UNFTGSY3BORUW63TTL5RWY2LDNM#discussion_r3131916292
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/7017/review/4163748074 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260423/5c3997df/attachment.htm>
More information about the rails-dev
mailing list