Skip to content

Commit

Permalink
Optimize stringbuffer_append to avoid strlen calls
Browse files Browse the repository at this point in the history
References #4614
  • Loading branch information
Algunenano committed Mar 5, 2020
1 parent 8eecc74 commit 8792203
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions liblwgeom/lwout_wkt.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,8 @@ static void ptarray_to_wkt_sb(const POINTARRAY *ptarray, stringbuffer_t *sb, int
/* Spaces before every ordinate but the first */
if ( j > 0 )
stringbuffer_append_len(sb, " ", 1);
lwprint_double(dbl_ptr[j],
precision,
coord,
buffer_size);
stringbuffer_append(sb, coord);
int len = lwprint_double(dbl_ptr[j], precision, coord, buffer_size);
stringbuffer_append_len(sb, coord, len);
}
}

Expand Down

0 comments on commit 8792203

Please sign in to comment.