Skip to content

Commit 9615a71

Browse files
committed
CRC: remove unnecessary brackets and store total_requests_sent as a local var
Signed-off-by: Jacinta Ferrant <[email protected]>
1 parent 4f9d620 commit 9615a71

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

stackslib/src/net/atlas/download.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,11 +1314,11 @@ impl ReliabilityReport {
13141314
}
13151315

13161316
pub fn score(&self) -> u32 {
1317-
if self.total_requests_sent == 0 {
1318-
return 0;
1317+
let n = self.total_requests_sent;
1318+
if n == 0 {
1319+
return n;
13191320
}
1320-
self.total_requests_success * 1000 / (self.total_requests_sent * 1000)
1321-
+ self.total_requests_sent
1321+
self.total_requests_success * 1000 / (n * 1000) + n
13221322
}
13231323
}
13241324

stackslib/src/util_lib/strings.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ impl StacksString {
207207
// This is 0x20 through 0x7e, inclusive, as well as '\t' and '\n'
208208
// TODO: DRY up with vm::representations
209209
for c in s.as_bytes().iter() {
210-
if (*c < 0x20 && *c != (b'\t') && *c != (b'\n')) || (*c > 0x7e) {
210+
if (*c < 0x20 && *c != b'\t' && *c != b'\n') || *c > 0x7e {
211211
return false;
212212
}
213213
}

0 commit comments

Comments
 (0)