OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/spdy/spdy_alt_svc_wire_format.h" | 5 #include "net/spdy/spdy_alt_svc_wire_format.h" |
6 | 6 |
| 7 #include <algorithm> |
7 #include <limits> | 8 #include <limits> |
8 #include <string> | 9 #include <string> |
9 | 10 |
10 #include "base/logging.h" | 11 #include "base/logging.h" |
11 #include "base/strings/stringprintf.h" | 12 #include "base/strings/stringprintf.h" |
12 | 13 |
13 namespace net { | 14 namespace net { |
14 | 15 |
15 using base::StringPiece; | 16 using base::StringPiece; |
16 | 17 |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 ++c; | 387 ++c; |
387 double place_value = 0.1; | 388 double place_value = 0.1; |
388 for (; c != end && isdigit(*c); ++c) { | 389 for (; c != end && isdigit(*c); ++c) { |
389 *probability += place_value * (*c - '0'); | 390 *probability += place_value * (*c - '0'); |
390 place_value *= 0.1; | 391 place_value *= 0.1; |
391 } | 392 } |
392 return (c == end && *probability <= 1.0); | 393 return (c == end && *probability <= 1.0); |
393 } | 394 } |
394 | 395 |
395 } // namespace net | 396 } // namespace net |
OLD | NEW |