Make bytes_to_python const non-static

This commit is contained in:
Pragyansh Chaturvedi
2025-11-27 03:55:58 +05:30
parent d4202cdc88
commit 8ac2d67a76
2 changed files with 3 additions and 2 deletions

View File

@ -1,6 +1,7 @@
#include "core/bpf_map.h"
#include "core/bpf_exception.h"
#include "core/bpf_object.h"
#include "utils/struct_parser.h"
#include <algorithm>
#include <cerrno>
#include <cstring>
@ -233,7 +234,7 @@ void BpfMap::python_to_bytes_inplace(const py::object &obj,
}
}
py::object BpfMap::bytes_to_python(std::span<const uint8_t> data) {
py::object BpfMap::bytes_to_python(std::span<const uint8_t> data) const {
// NOTE: Struct parsing for value type
if (struct_parser_ && !value_struct_name_.empty()) {
py::bytes py_data(reinterpret_cast<const char *>(data.data()), data.size());

View File

@ -79,7 +79,7 @@ public:
private:
static void python_to_bytes_inplace(const py::object &obj,
std::span<uint8_t> buffer);
static py::object bytes_to_python(std::span<const uint8_t> data);
py::object bytes_to_python(std::span<const uint8_t> data) const;
};
#endif // PYLIBBPF_BPF_MAP_H