Refactor: combine insert_keyframe() and insert_key_rna() into a single function #122053
@ -1039,9 +1039,7 @@ CombinedKeyingResult insert_keyframes(Main *bmain,
|
||||
* we're faithfully reproducing the original behavior.
|
||||
*/
|
||||
eInsertKeyFlags insert_key_flags_adjusted = insert_key_flags;
|
||||
if (force_all && rna_values.size() > 0 &&
|
||||
(insert_key_flags & (INSERTKEY_REPLACE | INSERTKEY_AVAILABLE)) != 0)
|
||||
{
|
||||
if (force_all && insert_key_flags & (INSERTKEY_REPLACE | INSERTKEY_AVAILABLE)) {
|
||||
nathanvegdahl marked this conversation as resolved
Outdated
|
||||
/* Determine if at least one element would succeed getting keyed. */
|
||||
nathanvegdahl marked this conversation as resolved
Outdated
Sybren A. Stüvel
commented
The The ` != 0` can be removed, which would, for me, increase the readability of this condition.
|
||||
bool at_least_one_would_succeed = false;
|
||||
for (int i = 0; i < rna_values.size(); i++) {
|
||||
|
Loading…
Reference in New Issue
Block a user
rna_values.size() > 0
→!rna_values.is_empty()
.But actually that part of the condition can be entirely removed. The chance of
rna_values
actually being empty is minute (why is this function even getting called, in that case?), and so this only 'optimizes' away two numerical comparisons and an assignment toat_least_one_would_succeed
.