Skip to content

Commit

Permalink
Fix 5d04360: Use C-style array to avoid std::array iterators
Browse files Browse the repository at this point in the history
  • Loading branch information
spnda committed Jan 26, 2025
1 parent 5d04360 commit 4236db9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/fastgltf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4086,12 +4086,11 @@ namespace fastgltf {
// (1) bidirectionally lossless (std::to_string is not)
// (2) quite a lot faster than std::to_chars and std::to_string.
std::string to_string_fp(const num& value) {
std::array<char, 30> buffer {};
buffer.fill(0);
char buffer[30] = {};

// TODO: Include a own copy of grisu2 instead of accessing functions from simdjson's internal namespace?
auto* end = simdjson::internal::to_chars(buffer.begin(), buffer.end(), value);
return {buffer.data(), end};
auto* end = simdjson::internal::to_chars(std::begin(buffer), std::end(buffer), value);
return {std::begin(buffer), end};
}

void writeTextureInfo(std::string& json, const TextureInfo* info, const TextureInfoType type = TextureInfoType::Standard) {
Expand Down

0 comments on commit 4236db9

Please sign in to comment.