Skip to content

Commit

Permalink
Merge pull request #97 from ArnaudWurmel/bugfix/crash-atomics-value
Browse files Browse the repository at this point in the history
[Bugfix] Crashes when reading the body in Release configurations
  • Loading branch information
Goos authored Jan 3, 2022
2 parents e87be01 + 6f84ef7 commit 287c134
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Sources/Atomic.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ final class Atomic<Value> {
@discardableResult
func modify(action: (Value) throws -> Value) rethrows -> Value {
return try withValue { value in
let oldValue = value
_value = try action(value)
return value
return oldValue
}
}

Expand Down

0 comments on commit 287c134

Please sign in to comment.