Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unused string in LoadBinaryFromFile in tiny_gltf.h #454

Closed
AntonSulimenkoHarman opened this issue Sep 7, 2023 · 2 comments
Closed

Unused string in LoadBinaryFromFile in tiny_gltf.h #454

AntonSulimenkoHarman opened this issue Sep 7, 2023 · 2 comments
Labels

Comments

@AntonSulimenkoHarman
Copy link

AntonSulimenkoHarman commented Sep 7, 2023

Describe the issue

in https://github.com/syoyo/tinygltf/blob/release/tiny_gltf.h

bool TinyGLTF::LoadBinaryFromMemory(...)
{

...

  // Extract JSON string.
  std::string jsonString(reinterpret_cast<const char *>(&bytes[20]),
                         chunk0_length);

LoadBinaryFromMemory creates a copy of JSON block, but this copy is never used: https://github.com/search?q=repo%3Asyoyo/tinygltf%20jsonString&type=code

To Reproduce

NA

Expected behaviour

Wasteless code.

Screenshots

NA

Additional context

NA

@syoyo
Copy link
Owner

syoyo commented Sep 7, 2023

Good find! The code should be safely deleted

@syoyo syoyo added the trivial label Sep 7, 2023
@syoyo
Copy link
Owner

syoyo commented Sep 7, 2023

Closed via 4b9cfc8

@syoyo syoyo closed this as completed Sep 7, 2023
nyalldawson pushed a commit to nyalldawson/tinygltf that referenced this issue Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants