Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@cjeker
Copy link
Contributor

@cjeker cjeker commented Feb 29, 2024

Return true or false from AddData().
Returns false and aborts the data addition if there is no change in the delta.
Use this to shortcut applyUpdateFromNewState() which prevents sending out notifications for empty deltas.

While detecting no file change for slurm using a hash (#115) prevents this case it still is an extra safety to prevent empty deltas to show up.

Returns false and aborts the data addition if there is no change in the delta.
Use this to shortcut applyUpdateFromNewState() which prevents sending out
notifications for empty deltas.
SDs = append(SDs, v.Copy())
}
s.server.AddData(SDs)
if (s.server.AddData(SDs) == false) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (s.server.AddData(SDs) == false) {
if !s.server.AddData(SDs) {

lib/server.go Outdated
s.sdlock.RUnlock()

s.AddSDsDiff(curDiff)
if (len(curDiff) == 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (len(curDiff) == 0) {
if len(curDiff) == 0 {

I think gofmt would have applied this automatically

@ties ties merged commit b93d7a8 into bgp:master Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants