Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Unified Diff: pkg/analysis_server/lib/src/utilities/average.dart

Issue 2959713002: Remove more dead code (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analysis_server/lib/src/utilities/average.dart
diff --git a/pkg/analysis_server/lib/src/utilities/average.dart b/pkg/analysis_server/lib/src/utilities/average.dart
deleted file mode 100644
index 22cf299b55beb03bd26cfaa92212dcb28c54bfa5..0000000000000000000000000000000000000000
--- a/pkg/analysis_server/lib/src/utilities/average.dart
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-/// Simple rolling average sample counter.
-class Average {
- num _val;
- final int _sampleCount;
-
- /// Create an average with the given (optional) sample count size.
- Average([this._sampleCount = 20]);
-
- /// The current average.
- num get value => _val ?? 0;
-
- /// Add the given [sample].
- void addSample(num sample) {
- if (_val == null) {
- _val = sample;
- } else {
- _val = _val * ((_sampleCount - 1) / _sampleCount) +
- sample * (1 / _sampleCount);
- }
- }
-
- @override
- String toString() => 'average: $value';
-}

Powered by Google App Engine
This is Rietveld 408576698