Reformat the WebRTC code base
Running clang-format with chromium's style guide.
The goal is n-fold:
* providing consistency and readability (that's what code guidelines are for)
* preventing noise with presubmit checks and git cl format
* building on the previous point: making it easier to automatically fix format issues
* you name it
Please consider using git-hyper-blame to ignore this commit.
Bug: webrtc:9340
Change-Id: I694567c4cdf8cee2860958cfe82bfaf25848bb87
Reviewed-on: https://webrtc-review.googlesource.com/81185
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23660}
diff --git a/rtc_base/ratetracker.cc b/rtc_base/ratetracker.cc
index 68bd8a1..e31d266 100644
--- a/rtc_base/ratetracker.cc
+++ b/rtc_base/ratetracker.cc
@@ -79,13 +79,12 @@
// Only count a portion of the first bucket according to how much of the
// first bucket is within the current interval.
size_t total_samples = ((sample_buckets_[start_bucket] *
- (bucket_milliseconds_ - milliseconds_to_skip)) +
- (bucket_milliseconds_ >> 1)) /
- bucket_milliseconds_;
+ (bucket_milliseconds_ - milliseconds_to_skip)) +
+ (bucket_milliseconds_ >> 1)) /
+ bucket_milliseconds_;
// All other buckets in the interval are counted in their entirety.
for (size_t i = NextBucketIndex(start_bucket);
- i != NextBucketIndex(current_bucket_);
- i = NextBucketIndex(i)) {
+ i != NextBucketIndex(current_bucket_); i = NextBucketIndex(i)) {
total_samples += sample_buckets_[i];
}
// Convert to samples per second.
@@ -125,7 +124,8 @@
}
// Ensure that bucket_start_time_milliseconds_ is updated appropriately if
// the entire buffer of samples has been expired.
- bucket_start_time_milliseconds_ += bucket_milliseconds_ *
+ bucket_start_time_milliseconds_ +=
+ bucket_milliseconds_ *
((current_time - bucket_start_time_milliseconds_) / bucket_milliseconds_);
// Add all samples in the bucket that includes the current time.
sample_buckets_[current_bucket_] += sample_count;