Skip to content
Snippets Groups Projects

Fix replications density

Merged
Ghost Userrequested to merge
fix-#300-rd-of-zero into master
1 open thread

It was 0.5 if message not met at all in a time window.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
115 115 }
116 116
117 117 // Else, update all replications densities:
118 int numberUniqueEncounters = this.uniqueEncountersInTimeWindow.size();
118 double numberUniqueEncounters = this.uniqueEncountersInTimeWindow.size();
119 119 for (String msgId : this.replicationsDensities.keySet()) {
120 // Set replications density for a message to the rate of hosts met with that message.
121 double newDensity;
  • Author Contributor

    The code is fine, but you could also directly set newDensity = 0 here and get rid of one of the branches of the if. This does not change anything, but it shortens the code

  • Please register or sign in to reply
  • Ghost User added 1 commit

    added 1 commit

    Compare with previous version

  • removed Needs Review label

  • merged

  • Ghost User mentioned in commit 9395f7a3

    mentioned in commit 9395f7a3

  • Please register or sign in to reply
    Loading