yakra / DataProcessing

Data Processing Scripts and Programs for Travel Mapping Project
0 stars 0 forks source link

Waypoint: refactor URL validation #239

Closed yakra closed 9 months ago

yakra commented 1 year ago

https://github.com/yakra/DataProcessing/blob/3c6595a96ac3ea53afcfbfbcbd951eea47165b72/siteupdate/cplusplus/classes/Waypoint/Waypoint.cpp#L69-L90

Verbose and redundant. Refactor off into its own function. Rewriting existing valid_num_str would be a PitA, and besides, why lose the ability to use it elsewhere?

This can wait until invalid Waypoints throw rather than set coords to (0,0). bool valid_line -> unsigned char invalid_line to throw.

yakra commented 1 year ago

From #198:

The initial if statements could also be refactored away as part of this, but would result in an extra function call. Would there be a performance hit, however tiny, in practice?

Ah sure it'll be grand