Skip to content

Commit

Permalink
tidy comments
Browse files Browse the repository at this point in the history
  • Loading branch information
drinckes committed Dec 30, 2024
1 parent 225d1c0 commit f2473d6
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions c/src/olc.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ int OLC_IsFull(const char* code, size_t size) {

int OLC_Encode(const OLC_LatLon* location, size_t length, char* code,
int maxlen) {
// Normalize longitude.
double latdeg = location->lat;
double londeg = location->lon;
// Add the maximum latitude and longitude to the values to move them into a
Expand All @@ -101,7 +100,7 @@ int OLC_Encode(const OLC_LatLon* location, size_t length, char* code,

int OLC_EncodeFixed(long long int lat, long long int lon, size_t length,
char* code, int maxlen) {
// Limit the maximum number of digits in the code.
// Ensure length is valid.
if (length > kMaximumDigitCount) {
length = kMaximumDigitCount;
} else if (length < kMinimumDigitCount) {
Expand Down Expand Up @@ -129,10 +128,6 @@ int OLC_EncodeFixed(long long int lat, long long int lon, size_t length,
char fullcode[] = "12345678901234567";

// Compute the code.
// This approach converts each value to an integer after multiplying it by
// the final precision. This allows us to use only integer operations, so
// avoiding any accumulation of floating point representation errors.

size_t pos = kMaximumDigitCount;
// Compute the grid part of the code if necessary.
if (length > kPairCodeLength) {
Expand Down

0 comments on commit f2473d6

Please sign in to comment.