Skip to content

Commit 6780b8c

Browse files
committed
Plugins (infinite): Move variable outside nested loop
Idea by Chong Kai Xiong (@kaixiong)
1 parent 5b1ea02 commit 6780b8c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • libvisual-plugins/plugins/actor/infinite

libvisual-plugins/plugins/actor/infinite/display.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,8 @@ static void _inf_compute_surface(InfinitePrivate *priv, t_interpol* vector_field
159159
#endif /* #if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64) */
160160
#endif /* #if 0 */
161161
} else {
162+
const uint8_t *ptr_pix_end = priv->surface1 + (priv->plugwidth * priv->plugheight);
163+
162164
for (j=0;j<priv->plugheight;j++) {
163165
for (i=0;i<priv->plugwidth;i++) {
164166
interpol = &vector_field[add_dest];
@@ -167,8 +169,6 @@ static void _inf_compute_surface(InfinitePrivate *priv, t_interpol* vector_field
167169
(void)add_src;
168170
ptr_pix = priv->surface1 + y * priv->plugwidth + x;
169171

170-
const uint8_t *ptr_pix_end = priv->surface1 + (priv->plugwidth * priv->plugheight);
171-
172172
color = ptr_pix[0] * (interpol->weight >> 24);
173173

174174
// right neigbor

0 commit comments

Comments
 (0)