Skip to content
Snippets Groups Projects
Commit 1c306367 authored by tunamonster's avatar tunamonster Committed by Alex Reisner
Browse files

Refactor calculations (#1116)

* Refactor calculations

Refactored calculations::extract_coordinates and calculations::coordinates_present?

coordinates_present?
Checks whether an argument matches validating criteria (numeric, not NaN), rather than returning false when matching invalidating criteria.

Also replaced .to_s == NaN with .to_f..nan? 

extract_coordinates 
Now calls coordinates_present? to validate the array, instead of comparing four booleans and initialising extra vars.

* Removed .map and ternary from coordinates_present?

Updated pull request according to Lime's suggestions.
parent 36778dfc
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment