Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
maxfierrog committed Apr 23, 2024
1 parent 1fe7973 commit 005505a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/solver/algorithm/strong/acyclic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,15 @@ where
let mut buf = RecordBuffer::new(game.players())
.context("Failed to create placeholder record.")?;
if db.get(curr).is_none() {
db.put(curr, &buf);
db.put(curr, &buf)?;
if game.end(curr) {
buf = RecordBuffer::new(game.players())
.context("Failed to create record for end state.")?;
buf.set_utility(game.utility(curr))
.context("Failed to copy utility values to record.")?;
buf.set_remoteness(0)
.context("Failed to set remoteness for end state.")?;
db.put(curr, &buf);
db.put(curr, &buf)?;
} else {
stack.push(curr);
stack.extend(
Expand Down Expand Up @@ -135,7 +135,7 @@ where
optimal
.set_remoteness(min_rem + 1)
.context("Failed to set remoteness for solved record.")?;
db.put(curr, &optimal);
db.put(curr, &optimal)?;
}
}
Ok(())
Expand All @@ -160,15 +160,15 @@ where
let mut buf = RecordBuffer::new(game.players())
.context("Failed to create placeholder record.")?;
if db.get(curr).is_none() {
db.put(curr, &buf);
db.put(curr, &buf)?;
if game.end(curr) {
buf = RecordBuffer::new(game.players())
.context("Failed to create record for end state.")?;
buf.set_utility(game.utility(curr))
.context("Failed to copy utility values to record.")?;
buf.set_remoteness(0)
.context("Failed to set remoteness for end state.")?;
db.put(curr, &buf);
db.put(curr, &buf)?;
} else {
stack.push(curr);
stack.extend(
Expand Down Expand Up @@ -202,7 +202,7 @@ where
optimal
.set_remoteness(min_rem + 1)
.context("Failed to set remoteness for solved record.")?;
db.put(curr, &optimal);
db.put(curr, &optimal)?;
}
}
Ok(())
Expand Down

0 comments on commit 005505a

Please sign in to comment.