We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 01fa4a6 commit e1ad7fcCopy full SHA for e1ad7fc
loader/include/Geode/utils/random.hpp
@@ -82,9 +82,9 @@ namespace geode::utils::random {
82
}
83
84
template <typename Cont>
85
- void shuffle(Cont& vec) {
+ void shuffle(Cont& cont) {
86
using std::begin, std::end;
87
- shuffle(begin(vec), end(vec));
+ shuffle(begin(cont), end(cont));
88
89
90
GEODE_DLL std::string generateString(size_t length, std::string_view alphabet);
loader/src/utils/random.cpp
@@ -75,9 +75,10 @@ void fillBytes(void* buffer, size_t size) {
75
buf += 8;
76
size -= 8;
77
78
-
79
- for (size_t i = 0; i < size; i++) {
80
- buf[i] = generate<uint8_t>();
+
+ if (size > 0) {
+ uint64_t val = nextU64();
81
+ std::memcpy(buf, &val, size);
0 commit comments