aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-09-16 19:43:21 -0400
committerDavid Robillard <d@drobilla.net>2022-09-16 22:31:06 -0400
commit1dc3dbdf5989a8f1ccb97e74ac30758e79b3a8f2 (patch)
tree8d86edb255c8bec0bc261a8d558efca0392c0dd8
parent6ff6556a531e06217fe5e7ad86d2093b3c79ea7c (diff)
downloadchilbert-1dc3dbdf5989a8f1ccb97e74ac30758e79b3a8f2.tar.gz
chilbert-1dc3dbdf5989a8f1ccb97e74ac30758e79b3a8f2.tar.bz2
chilbert-1dc3dbdf5989a8f1ccb97e74ac30758e79b3a8f2.zip
Use "auto" to avoid repeating types
-rw-r--r--.clang-tidy1
-rw-r--r--include/chilbert/chilbert.ipp8
2 files changed, 4 insertions, 5 deletions
diff --git a/.clang-tidy b/.clang-tidy
index d4f85ba..b47495c 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -6,7 +6,6 @@ Checks: >
-*-named-parameter,
-*-no-malloc,
-*-non-private-member-variables-in-classes,
- -*-use-auto,
-altera-*,
-bugprone-easily-swappable-parameters,
-cert-oop54-cpp,
diff --git a/include/chilbert/chilbert.ipp b/include/chilbert/chilbert.ipp
index 0b6587a..db75a62 100644
--- a/include/chilbert/chilbert.ipp
+++ b/include/chilbert/chilbert.ipp
@@ -222,7 +222,7 @@ coords_to_index(const P& p,
// Work from MSB to LSB
size_t d = D0;
size_t ho = m * n;
- for (intptr_t i = static_cast<intptr_t>(m - 1); i >= 0; --i) {
+ for (auto i = static_cast<intptr_t>(m - 1); i >= 0; --i) {
if (ds) {
ds[i] = d;
}
@@ -270,7 +270,7 @@ index_to_coords(P& p, const size_t m, const size_t n, const H& h, I&& scratch)
// Work from MSB to LSB
size_t d = D0;
size_t ho = m * n;
- for (intptr_t i = static_cast<intptr_t>(m - 1); i >= 0; --i) {
+ for (auto i = static_cast<intptr_t>(m - 1); i >= 0; --i) {
// Get the Hilbert index bits
ho -= n;
get_bits<H, I>(h, n, ho, w);
@@ -322,7 +322,7 @@ coords_to_compact_index(const P& p,
// If we could avoid allocation altogether (ie: have a
// fixed buffer allocated on the stack) then this increases
// speed by a bit (4% when n=4, m=20)
- size_t* const ds = new size_t[m];
+ auto* const ds = new size_t[m];
if (mn > SmallBitVec::bits_per_rack) {
DynamicBitVec h(mn);
@@ -382,7 +382,7 @@ compact_index_to_coords(P& p,
// Work from MSB to LSB
size_t d = D0;
- for (intptr_t i = static_cast<intptr_t>(m - 1); i >= 0; --i) {
+ for (auto i = static_cast<intptr_t>(m - 1); i >= 0; --i) {
// Get the mask and ptrn
size_t b = 0;
extract_mask<I>(ms, n, d, static_cast<size_t>(i), mask, b);