Use vec.data() instead of &vec[0]

In general `vec.data()` is always safe, whereas `&vec[0]`
may fail when `vec` is empty.
This commit is contained in:
Rangi42
2024-02-28 21:05:06 -05:00
committed by Sylvie
parent d1fa5ccd4d
commit 2ff723f943
4 changed files with 5 additions and 5 deletions

View File

@@ -557,7 +557,7 @@ void rpn_BinaryOp(enum RPNCommand op, struct Expression *expr,
len = sizeof(bytes);
patchSize = sizeof(bytes);
} else {
ptr = &(*src2->rpn)[0]; // Pointer to the right RPN
ptr = src2->rpn->data(); // Pointer to the right RPN
len = src2->rpn->size(); // Size of the right RPN
patchSize = src2->rpnPatchSize;
}