Skip to content

Commit

Permalink
change operation order
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin C Presley committed Feb 12, 2024
1 parent 76dc920 commit f866c39
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Reuse of a variable during `StateVector` encoding.

## Fixed
- While a SVS `Core` is in `Suppression`, Incoming `StateVector`s are handled much more efficiently. Only loops through the `StateVector` entries once instead of twice.
- Removed many small inefficiencies in SVS `Core` logic. Operations were found unnecessary in both `Suppression` and `Steady` states.

## [v0.0.0-alpha.13] - 2024-02-09
## Added
Expand Down
6 changes: 3 additions & 3 deletions pkg/svs/twostate_core.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,13 @@ func (c *twoStateCore) onTimer() {
c.sendInterest()
} else {
c.recordMtx.Lock()
defer c.recordMtx.Unlock()
localNewer := c.mergeRecordToLocal()
c.record = NewStateVector()
c.recordMtx.Unlock()
atomic.StoreInt32(c.state, steadyState)
if localNewer {
c.sendInterest()
}
atomic.StoreInt32(c.state, steadyState)
c.record = NewStateVector()
}
}

Expand Down

0 comments on commit f866c39

Please sign in to comment.