Skip to content

Commit b85b9f9

Browse files
committed
fix handling of protected programs
1 parent d28c4fc commit b85b9f9

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ To install or update LODA, please follow the [installation instructions](https:/
22

33
## [Unreleased]
44

5+
### Bugfixes
6+
7+
* Fix handling of protected programs
8+
59
# v22.6.27
610

711
### Bugfixes

src/oeis_manager.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,13 +250,10 @@ bool OeisManager::shouldMatch(const OeisSequence &seq) const {
250250
return false;
251251
}
252252

253-
// sequence on the deny or protect list?
253+
// sequence on the deny list?
254254
if (deny_list.find(seq.id) != deny_list.end()) {
255255
return false;
256256
}
257-
if (protect_list.find(seq.id) != protect_list.end()) {
258-
return false;
259-
}
260257

261258
// too many invalid matches already?
262259
bool too_many_matches = false;
@@ -272,6 +269,11 @@ bool OeisManager::shouldMatch(const OeisSequence &seq) const {
272269
(seq.id < stats->all_program_ids.size()) &&
273270
stats->all_program_ids[seq.id];
274271

272+
// program exists and protected?
273+
if (prog_exists && protect_list.find(seq.id) != protect_list.end()) {
274+
return false;
275+
}
276+
275277
// decide based on overwrite mode
276278
switch (overwrite_mode) {
277279
case OverwriteMode::NONE:

0 commit comments

Comments
 (0)