-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduce code duplication in elevation_add() for #37
- Loading branch information
1 parent
b153e6a
commit 6ba560d
Showing
1 changed file
with
5 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6ba560d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heads-up @ateucher, this was my attempt at refactoring to dedupe code. There is more that could be done, tried a few other things below the
null
call above but didn't seem to do much... If you see any quick wins please let me know, great to have more eyes on it and apologies for the unsolicited ping!6ba560d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me @Robinlovelace - much cleaner!
One small nit - in line 425 (
rgeom3d_line = sf::st_linestring(m_xyz[m[, 3] == i, ])
), assigning torgeom3d_line
is unnecessary (and I would have thought it meant that the anonymous function wouldn't return anything - but it does - strange!).6ba560d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah, seems obvious now, not sure how I missed that. Anonymous functions ahoy!
6ba560d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed here, many thanks @ateucher ! 20e8e90