baturin/wikivoyage-listings

Multiple calls to same getter, maybe use a variable

Opened this issue · 1 comments

poi.getUrl() called 3 times at L14 and 15, and the getter has an If, it's not a simple property fetch

if (poi.getUrl() != null && !poi.getUrl().equals("")) {

Just a minor gripe, I didn't find a Discussion place for this, and pretty sure this won't be high priority and optimization will come really late in the timeline, so feel free to delete this issue.
Other files have this, too:

if (poi.getEmail() != null && !poi.getEmail().equals("")) {

and Line 9

Thanks!
Feel free to send a pull request :-)