summaryrefslogtreecommitdiff
path: root/core/variant
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2021-04-05 14:09:59 +0200
committerRémi Verschelde <rverschelde@gmail.com>2021-04-05 14:09:59 +0200
commitd83761ba80b90e17aaefaa83c7ece0fa89511266 (patch)
tree39544b604c8be6cf6daa56a2a7774426d394c2a3 /core/variant
parent9bbe51dc279e1203962bdf0b3266c9b14307638c (diff)
Style: Apply clang-tidy's `readability-braces-around-statements`
Diffstat (limited to 'core/variant')
-rw-r--r--core/variant/variant_setget.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/variant/variant_setget.cpp b/core/variant/variant_setget.cpp
index b86ae3ebb2..f319631ce5 100644
--- a/core/variant/variant_setget.cpp
+++ b/core/variant/variant_setget.cpp
@@ -891,8 +891,9 @@ struct VariantIndexedSetGet_Array {
static void ptr_get(const void *base, int64_t index, void *member) {
/* avoid ptrconvert for performance*/
const Array &v = *reinterpret_cast<const Array *>(base);
- if (index < 0)
+ if (index < 0) {
index += v.size();
+ }
OOB_TEST(index, v.size());
PtrToArg<Variant>::encode(v[index], member);
}
@@ -925,8 +926,9 @@ struct VariantIndexedSetGet_Array {
static void ptr_set(void *base, int64_t index, const void *member) {
/* avoid ptrconvert for performance*/
Array &v = *reinterpret_cast<Array *>(base);
- if (index < 0)
+ if (index < 0) {
index += v.size();
+ }
OOB_TEST(index, v.size());
v.set(index, PtrToArg<Variant>::convert(member));
}