summaryrefslogtreecommitdiff
path: root/ZAPD/ZResource.cpp
diff options
context:
space:
mode:
authorAnghelo Carvajal <angheloalf95@gmail.com>2021-06-04 12:52:38 -0400
committerGitHub <noreply@github.com>2021-06-04 12:52:38 -0400
commit726ff528a3ab66afde92b5b6e70a96f168fee041 (patch)
treeba3ff371bc2fd89a448ea6914b45dea10c8ca20c /ZAPD/ZResource.cpp
parentca229f19b991c613c29afade3d70b100522cece1 (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/ZResource.cpp')
-rw-r--r--ZAPD/ZResource.cpp17
1 files changed, 2 insertions, 15 deletions
diff --git a/ZAPD/ZResource.cpp b/ZAPD/ZResource.cpp
index 55e142f..f64ce4a 100644
--- a/ZAPD/ZResource.cpp
+++ b/ZAPD/ZResource.cpp
@@ -21,10 +21,8 @@ ZResource::ZResource(ZFile* nParent)
RegisterOptionalAttribute("Custom");
}
-void ZResource::ExtractFromXML(tinyxml2::XMLElement* reader, const std::vector<uint8_t>& nRawData,
- const uint32_t nRawDataIndex)
+void ZResource::ExtractFromXML(tinyxml2::XMLElement* reader, uint32_t nRawDataIndex)
{
- rawData = nRawData;
rawDataIndex = nRawDataIndex;
if (reader != nullptr)
@@ -34,9 +32,8 @@ void ZResource::ExtractFromXML(tinyxml2::XMLElement* reader, const std::vector<u
CalcHash();
}
-void ZResource::ExtractFromFile(const std::vector<uint8_t>& nRawData, uint32_t nRawDataIndex)
+void ZResource::ExtractFromFile(uint32_t nRawDataIndex)
{
- rawData = nRawData;
rawDataIndex = nRawDataIndex;
ParseRawData();
@@ -160,16 +157,6 @@ std::string ZResource::GetExternalExtension() const
return "";
}
-const std::vector<uint8_t>& ZResource::GetRawData() const
-{
- return rawData;
-}
-
-void ZResource::SetRawData(const std::vector<uint8_t>& nData)
-{
- rawData = nData;
-}
-
bool ZResource::WasDeclaredInXml() const
{
return declaredInXml;