Explorar o código

hle: nvflinger: parcel: Reserve token size.

bunnei %!s(int64=4) %!d(string=hai) anos
pai
achega
7db60fe7da
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      src/core/hle/service/nvflinger/parcel.h

+ 2 - 1
src/core/hle/service/nvflinger/parcel.h

@@ -89,7 +89,8 @@ public:
         [[maybe_unused]] const u32 unknown = Read<u32>();
         const u32 length = Read<u32>();
 
-        std::u16string token{};
+        std::u16string token;
+        token.reserve(length + 1);
 
         for (u32 ch = 0; ch < length + 1; ++ch) {
             token.push_back(ReadUnaligned<u16>());