Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2021-07-05 15:00:46 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-07-05 15:02:57 +0300
commit2ecc33d84b7c4cd1a235bd6afb4dd306a8b3dfc8 (patch)
tree45a73225d2fb11d8fddf8a5c6891eae0c4f5e451
parent6eb8340ef45a2bc4d28db5430f1cf9e890c93c3e (diff)
Cleanup: move repeated assignment out of nested for loop
-rw-r--r--source/blender/editors/space_image/image_ops.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c
index 3e8ac060862..6b9821745c7 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -2734,8 +2734,8 @@ static int image_flip_exec(bContext *C, wmOperator *op)
float *orig_float_pixels = MEM_dupallocN(float_pixels);
for (int x = 0; x < size_x; x++) {
+ const int source_pixel_x = use_flip_x ? size_x - x - 1 : x;
for (int y = 0; y < size_y; y++) {
- const int source_pixel_x = use_flip_x ? size_x - x - 1 : x;
const int source_pixel_y = use_flip_y ? size_y - y - 1 : y;
const float *source_pixel =
@@ -2755,8 +2755,8 @@ static int image_flip_exec(bContext *C, wmOperator *op)
char *char_pixels = (char *)ibuf->rect;
char *orig_char_pixels = MEM_dupallocN(char_pixels);
for (int x = 0; x < size_x; x++) {
+ const int source_pixel_x = use_flip_x ? size_x - x - 1 : x;
for (int y = 0; y < size_y; y++) {
- const int source_pixel_x = use_flip_x ? size_x - x - 1 : x;
const int source_pixel_y = use_flip_y ? size_y - y - 1 : y;
const char *source_pixel =