File tree Expand file tree Collapse file tree 3 files changed +68
-2
lines changed
Expand file tree Collapse file tree 3 files changed +68
-2
lines changed Original file line number Diff line number Diff line change 1+ # Licensed to the Apache Software Foundation (ASF) under one
2+ # or more contributor license agreements. See the NOTICE file
3+ # distributed with this work for additional information
4+ # regarding copyright ownership. The ASF licenses this file
5+ # to you under the Apache License, Version 2.0 (the
6+ # "License"); you may not use this file except in compliance
7+ # with the License. You may obtain a copy of the License at
8+ #
9+ # http://www.apache.org/licenses/LICENSE-2.0
10+ #
11+ # Unless required by applicable law or agreed to in writing,
12+ # software distributed under the License is distributed on an
13+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+ # KIND, either express or implied. See the License for the
15+ # specific language governing permissions and limitations
16+ # under the License.
17+ ---
18+ Checks : |
19+ clang-diagnostic-*,
20+ clang-analyzer-*,
21+ -clang-analyzer-alpha*,
22+ google-*,
23+ modernize-*,
24+ -modernize-avoid-c-arrays,
25+ -modernize-use-trailing-return-type,
26+ -modernize-use-nodiscard,
27+
28+ CheckOptions :
29+ - key : google-readability-braces-around-statements.ShortStatementLines
30+ value : ' 1'
31+ - key : google-readability-function-size.StatementThreshold
32+ value : ' 800'
33+ - key : google-readability-namespace-comments.ShortNamespaceLines
34+ value : ' 10'
35+ - key : google-readability-namespace-comments.SpacesBeforeComments
36+ value : ' 2'
Original file line number Diff line number Diff line change 1+ # Licensed to the Apache Software Foundation (ASF) under one
2+ # or more contributor license agreements. See the NOTICE file
3+ # distributed with this work for additional information
4+ # regarding copyright ownership. The ASF licenses this file
5+ # to you under the Apache License, Version 2.0 (the
6+ # "License"); you may not use this file except in compliance
7+ # with the License. You may obtain a copy of the License at
8+ #
9+ # http://www.apache.org/licenses/LICENSE-2.0
10+ #
11+ # Unless required by applicable law or agreed to in writing,
12+ # software distributed under the License is distributed on an
13+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+ # KIND, either express or implied. See the License for the
15+ # specific language governing permissions and limitations
16+ # under the License.
17+
18+ # To use this, install the python package `pre-commit` and
19+ # run once `pre-commit install`. This will setup a git pre-commit-hook
20+ # that is executed on each commit and will report the linting problems.
21+ # To run all hooks on all files use `pre-commit run -a`
22+
23+ repos :
24+ - repo : https://github.com/pocc/pre-commit-hooks
25+ rev : v1.3.5
26+ hooks :
27+ - id : clang-tidy
28+ args : ['--quiet', '-p=build/compile_commands.json', '--config-file=.clang-tidy']
29+ types_or : [c++, c]
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ uint64_t count_min_sketch<W,A>::get_seed() const {
7474
7575template <typename W, typename A>
7676double count_min_sketch<W,A>::get_relative_error() const {
77- return exp (1.0 ) / double (_num_buckets);
77+ return exp (1.0 ) / static_cast < double > (_num_buckets);
7878}
7979
8080template <typename W, typename A>
@@ -449,8 +449,9 @@ string<A> count_min_sketch<W,A>::to_string() const {
449449 // count the number of used entries in the sketch
450450 uint64_t num_nonzero = 0 ;
451451 for (const auto entry: _sketch_array) {
452- if (entry != static_cast <W>(0.0 ))
452+ if (entry != static_cast <W>(0.0 )){
453453 ++num_nonzero;
454+ }
454455 }
455456
456457 // Using a temporary stream for implementation here does not comply with AllocatorAwareContainer requirements.
You can’t perform that action at this time.
0 commit comments