mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user