mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
Fix minor style defects found by cppcheck
* add const keyword for constant functions * reduce the scope of variables if possible Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
This commit is contained in:
parent
f168e4bd7b
commit
714d398364
12 changed files with 29 additions and 33 deletions
|
|
@ -804,8 +804,8 @@ CacheStringTable* CodeCacheReader::loadStringTable(Context* context)
|
|||
size_t maxLength = m_buffer.get<size_t>();
|
||||
size_t tableSize = m_buffer.get<size_t>();
|
||||
|
||||
size_t length;
|
||||
if (LIKELY(!has16BitString)) {
|
||||
size_t length;
|
||||
LChar* buffer = new LChar[maxLength + 1];
|
||||
for (size_t i = 0; i < tableSize; i++) {
|
||||
length = m_buffer.get<size_t>();
|
||||
|
|
@ -822,13 +822,11 @@ CacheStringTable* CodeCacheReader::loadStringTable(Context* context)
|
|||
delete[] buffer;
|
||||
|
||||
} else {
|
||||
bool is8Bit;
|
||||
size_t length;
|
||||
LChar* lBuffer = new LChar[maxLength + 1];
|
||||
UChar* uBuffer = new UChar[maxLength + 1];
|
||||
for (size_t i = 0; i < tableSize; i++) {
|
||||
is8Bit = m_buffer.get<bool>();
|
||||
length = m_buffer.get<size_t>();
|
||||
bool is8Bit = m_buffer.get<bool>();
|
||||
size_t length = m_buffer.get<size_t>();
|
||||
|
||||
if (is8Bit) {
|
||||
m_buffer.getData(lBuffer, length);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue