!243 restool新需求,优化编码规范

Merge pull request !243 from HanSY/fixCleanCode
This commit is contained in:
openharmony_ci
2025-06-20 03:46:32 +00:00
committed by Gitee
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -17,6 +17,7 @@
#define OHOS_RESTOOL_RESOURCE_TABLE_H
#include <fstream>
#include <map>
#include <memory>
#include <sstream>
#include <unordered_map>
@@ -115,7 +116,7 @@ private:
uint32_t resId = 0;
uint32_t length = 0;
uint32_t valueCount = 0;
std::unordered_map<uint32_t, uint32_t> dataOffset; // <resConfigId, offset>
std::map<uint32_t, uint32_t> dataOffset; // <resConfigId, offset>
};
struct DataHeader {
+1 -1
View File
@@ -315,7 +315,7 @@ void ResourceTable::PrepareResIndex(IdSetHeader &idSetHeader, const TableData &t
ResIndex resIndex;
resIndex.resId = tableData.id;
resIndex.name = tableData.resourceItem.GetName();
resIndex.name = ResourceUtil::GetIdName(tableData.resourceItem.GetName(), resType);
resIndex.length = resIndex.name.length();
idSetHeader.resTypes[resType].resIndexs[tableData.id] = resIndex;
idSetHeader.resTypes[resType].length += ResIndex::RES_INDEX_LEN + resIndex.length;