Remove unnecessary const_cast

This commit is contained in:
FutureRave 2022-03-23 12:11:12 +00:00
parent d11d97932b
commit 81a8200d22
No known key found for this signature in database
GPG Key ID: E883E2BC9657D955
5 changed files with 5 additions and 7 deletions

View File

@ -346,8 +346,6 @@ links {"common"}
resincludedirs {"$(ProjectDir)src"}
links {"common"}
dependencies.imports()
group "Dependencies"

View File

@ -36,7 +36,7 @@ namespace utils
buffer = buffer.substr(1);
}
auto key_values = string::split(buffer, '\\');
const auto key_values = string::split(buffer, '\\');
for (size_t i = 0; !key_values.empty() && i < (key_values.size() - 1); i += 2)
{
const auto& key = key_values[i];

View File

@ -9,8 +9,8 @@ namespace utils
{
public:
info_string() = default;
info_string(const std::string& buffer);
info_string(const std::string_view& buffer);
explicit info_string(const std::string& buffer);
explicit info_string(const std::string_view& buffer);
void set(const std::string& key, const std::string& value);
std::string get(const std::string& key) const;

View File

@ -64,7 +64,7 @@ namespace utils::io
if (size > -1)
{
data->resize(static_cast<uint32_t>(size));
stream.read(const_cast<char*>(data->data()), size);
stream.read(data->data(), size);
stream.close();
return true;
}

View File

@ -14,7 +14,7 @@ namespace utils
{
std::lock_guard _(this->mutex_);
for (auto& data : this->pool_)
for (const auto& data : this->pool_)
{
memory::free(data);
}