MCPcopy Create free account
hub / github.com/NoMercy-ac/NoMercy / Reserve

Method Reserve

Source/Client/NM_Sys/API/StringsAPI.h:643–663  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

641 }
642
643 void Reserve(size_t Characters) {
644 if (Characters == Data.Length) return;
645 if (Characters < Data.Length) {
646 Resize(Characters);
647 return;
648 }
649 STRING_INFO StringInfo = {};
650 if (Characters < SSO_SIZE) {
651 if (Data.SsoUsing) return;
652 SetupSso(&StringInfo, SsoBuffer);
653 Copy(StringInfo.Buffer, Data.Buffer, Data.Length);
654 Free(&Data);
655 Data = StringInfo;
656 } else {
657 if (Alloc(&StringInfo, Characters)) {
658 Copy(StringInfo.Buffer, Data.Buffer, Data.Length);
659 Free(&Data);
660 Data = StringInfo;
661 }
662 }
663 }
664
665 String& Replace(
666 const TChar* Substr,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected