create a specific esm reader function for RefID to avoid allocation for string and then again for RefId

Fixed some types

removed useless header

applied clang format

fixed compile tests

fixed clang tidy, and closer to logic before this MR

Removed hardcoded refids

unless there is a returned value we don't use static RefIds
can use == between RefId and hardcoded string

Fix clang format

Fixed a few instances where std::string was used, when only const std::string& was needed

removed unused variable
This commit is contained in:
florent.teppe 2022-10-18 09:26:55 +02:00
parent 874ff88288
commit 65cdd489fb
194 changed files with 814 additions and 700 deletions

View file

@ -1,10 +1,10 @@
#ifndef INTERPRETER_CONTEXT_H_INCLUDED
#define INTERPRETER_CONTEXT_H_INCLUDED
#include <components/esm/refid.hpp>
#include <string>
#include <string_view>
#include <vector>
#include <components/esm/refid.hpp>
namespace Interpreter
{

View file

@ -213,11 +213,8 @@ namespace Interpreter
/* if list of globals is empty, grab it and sort it by descending string length */
if (globals.empty())
{
auto globalIds = context.getGlobals();
for (auto id : globalIds)
{
globals.push_back(id);
}
globals = context.getGlobals();
;
sort(globals.begin(), globals.end(), longerStr);
}