Skip to content

Commit 0a6fafd

Browse files
committed
Stuff I missed
1 parent b58e513 commit 0a6fafd

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024-2025 hiimjasmine00
3+
Copyright (c) 2024-2026 hiimjasmine00
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

changelog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Search History Changelog
2-
## v1.2.1 (2026-02-04)
2+
## v1.2.1 (2026-02-05)
33
- Ported to Geometry Dash v2.208 / Geode SDK v5.0.0
44

55
## v1.2.0 (2025-10-26)

src/SearchHistory.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@ using namespace geode::prelude;
77
std::vector<SearchHistoryObject> SearchHistory::history;
88

99
$on_mod(Loaded) {
10-
for (auto& object : Mod::get()->getSavedValue<std::vector<SearchHistoryObject>>("search-history")) {
11-
if (!std::ranges::contains(SearchHistory::history, object)) {
12-
SearchHistory::history.push_back(std::move(object));
10+
auto history = Mod::get()->getSavedValue<std::vector<SearchHistoryObject>>("search-history");
11+
for (auto it = history.begin(); it != history.end();) {
12+
if (!std::ranges::contains(SearchHistory::history, *it)) {
13+
SearchHistory::history.push_back(std::move(*it));
14+
it = history.erase(it);
1315
}
16+
else ++it;
1417
}
1518
SearchHistory::update();
1619
}

src/SearchHistory.hpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,12 @@ struct SearchHistoryObject {
3030
bool empty() const;
3131
};
3232

33-
class SearchHistory {
34-
public:
35-
static std::vector<SearchHistoryObject> history;
33+
namespace SearchHistory {
34+
extern std::vector<SearchHistoryObject> history;
3635

37-
static void add(GJSearchObject*, std::vector<int>, std::vector<int>, int);
38-
static void remove(int);
39-
static void update();
36+
void add(GJSearchObject*, std::vector<int>, std::vector<int>, int);
37+
void remove(int);
38+
void update();
4039
};
4140

4241
template<>

0 commit comments

Comments
 (0)