Skip to content
Snippets Groups Projects
Commit f8d14bfe authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files

Tired code is tired.

parent 23c2276a
No related branches found
No related tags found
No related merge requests found
...@@ -87,23 +87,17 @@ LLSD LLMaterialID::asLLSD() const ...@@ -87,23 +87,17 @@ LLSD LLMaterialID::asLLSD() const
std::string LLMaterialID::asString() const std::string LLMaterialID::asString() const
{ {
return fmt::format(FMT_COMPILE("{:02x}{:02x}{:02x}{:02x}-{:02x}{:02x}-{:02x}{:02x}-{:02x}{:02x}-{:02x}{:02x}{:02x}{:02x}{:02x}{:02x}"), std::string materialIDString;
(U8)(mID[0]), for (unsigned int i = 0U; i < static_cast<unsigned int>(MATERIAL_ID_SIZE / sizeof(U32)); ++i)
(U8)(mID[1]), {
(U8)(mID[2]), if (i != 0U)
(U8)(mID[3]), {
(U8)(mID[4]), materialIDString += "-";
(U8)(mID[5]), }
(U8)(mID[6]), const U32* value = reinterpret_cast<const U32*>(&get()[i * sizeof(U32)]);
(U8)(mID[7]), materialIDString += llformat("%08x", *value);
(U8)(mID[8]), }
(U8)(mID[9]), return materialIDString;
(U8)(mID[10]),
(U8)(mID[11]),
(U8)(mID[12]),
(U8)(mID[13]),
(U8)(mID[14]),
(U8)(mID[15]));
} }
std::ostream& operator<<(std::ostream& s, const LLMaterialID &material_id) std::ostream& operator<<(std::ostream& s, const LLMaterialID &material_id)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment