diff options
| author | Anghelo Carvajal <angheloalf95@gmail.com> | 2021-06-04 12:52:38 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-04 12:52:38 -0400 |
| commit | 726ff528a3ab66afde92b5b6e70a96f168fee041 (patch) | |
| tree | ba3ff371bc2fd89a448ea6914b45dea10c8ca20c /ZAPD/ZString.cpp | |
| parent | ca229f19b991c613c29afade3d70b100522cece1 (diff) | |
Optimize RAM usage and performance by removing redundant `rawData` (#148)
* Remove rawData from ZResource
* Remove dlistRawData and some leftovers extra params
* Run format
* Unused variable warning
Diffstat (limited to 'ZAPD/ZString.cpp')
| -rw-r--r-- | ZAPD/ZString.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ZAPD/ZString.cpp b/ZAPD/ZString.cpp index 24ef2d6..50545da 100644 --- a/ZAPD/ZString.cpp +++ b/ZAPD/ZString.cpp @@ -13,7 +13,8 @@ ZString::ZString(ZFile* nParent) : ZResource(nParent) void ZString::ParseRawData() { size_t size = 0; - uint8_t* rawDataArr = rawData.data(); + const auto& rawData = parent->GetRawData(); + const auto& rawDataArr = rawData.data(); size_t rawDataSize = rawData.size(); for (size_t i = rawDataIndex; i < rawDataSize; ++i) { @@ -43,7 +44,7 @@ std::string ZString::GetSourceOutputCode(const std::string& prefix) std::string ZString::GetSourceOutputHeader(const std::string& prefix) { - return StringHelper::Sprintf("#define %s_macro \"%s\"", name.c_str(), rawData.data()); + return StringHelper::Sprintf("#define %s_macro \"%s\"", name.c_str(), strData.data()); } std::string ZString::GetSourceTypeName() const |
