diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-07-05 15:00:46 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-07-05 15:02:57 +0300 |
commit | 2ecc33d84b7c4cd1a235bd6afb4dd306a8b3dfc8 (patch) | |
tree | 45a73225d2fb11d8fddf8a5c6891eae0c4f5e451 /source/blender/editors/space_image | |
parent | 6eb8340ef45a2bc4d28db5430f1cf9e890c93c3e (diff) |
Cleanup: move repeated assignment out of nested for loop
Diffstat (limited to 'source/blender/editors/space_image')
-rw-r--r-- | source/blender/editors/space_image/image_ops.c | 4 |
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 = |