mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-30 05:05:19 -05:00
* sys: Updated curl to latest version * sys: Fix macOS compilation * ui: Fix splash screen OpenGL init for macOS * sys: Fix std::min compile errors * git: Re-enabled macos workflow * sys: Remove includes of the range library * build: Find OpenGL using CMake * sys/build: Fix bundled plugins on macOS * build: Copy plugins to bundle when creating a bundle * build: Fixup bundled plugins * sys: Search for plugins in the bundle instead of in Application Support * sys: Allow resources to be placed in multiple directories on macOS * build: Output built plugins to the plugins/ directory when not creating a bundle on macOS * sys: Fix Application Support paths on macOS * sys: Define ftruncate64 on macOS * sys: Fix absolute value computation for std::string::at on macOS Co-authored-by: WerWolv <werwolv98@gmail.com>
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
#include "helpers/encoding_file.hpp"
|
||||
|
||||
#include <ranges>
|
||||
#include <hex/helpers/utils.hpp>
|
||||
|
||||
#include <fstream>
|
||||
@@ -17,7 +16,9 @@ namespace hex {
|
||||
}
|
||||
|
||||
std::pair<std::string_view, size_t> EncodingFile::getEncodingFor(const std::vector<u8> &buffer) const {
|
||||
for (const auto &[size, mapping] : this->m_mapping | std::views::reverse) {
|
||||
for (auto riter = this->m_mapping.crbegin(); riter != this->m_mapping.crend(); ++riter) {
|
||||
const auto &[size, mapping] = *riter;
|
||||
|
||||
if (size > buffer.size()) continue;
|
||||
|
||||
auto key = std::vector<u8>(buffer.begin(), buffer.begin() + size);
|
||||
|
||||
Reference in New Issue
Block a user