From 24ad2e3c99c961f3536bbea5c1ee5c96f44d20eb Mon Sep 17 00:00:00 2001 From: Vincent Rabaud Date: Mon, 7 Aug 2017 23:02:15 +0200 Subject: [PATCH] add const to two variables Change-Id: I97374ccbf118baa59425346ffc439036a4482bf4 --- src/enc/backward_references_enc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/enc/backward_references_enc.c b/src/enc/backward_references_enc.c index 06d57283..f6b1ceb0 100644 --- a/src/enc/backward_references_enc.c +++ b/src/enc/backward_references_enc.c @@ -609,8 +609,10 @@ static int BackwardReferencesLz77Box(int xsize, int ysize, // Figure out if we should use the offset/length from the previous pixel // as an initial guess and therefore only inspect the offsets in // window_offsets_new[]. - int use_prev = (best_length_prev > 1) && (best_length_prev < MAX_LENGTH); - int num_ind = use_prev ? window_offsets_new_size : window_offsets_size; + const int use_prev = + (best_length_prev > 1) && (best_length_prev < MAX_LENGTH); + const int num_ind = + use_prev ? window_offsets_new_size : window_offsets_size; best_length = use_prev ? best_length_prev - 1 : 0; best_offset = use_prev ? best_offset_prev : 0; // Find the longest match in a window around the pixel.