File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -184,7 +184,8 @@ int git_mwindow_contains(git_mwindow *win, off64_t offset)
184184/*
185185 * Find the least- or most-recently-used window in a file that is not currently
186186 * being used. The 'only_unused' flag controls whether the caller requires the
187- * file to only have unused windows.
187+ * file to only have unused windows. If '*out_window' is non-null, it is used as
188+ * a starting point for the comparison.
188189 *
189190 * Returns whether such a window was found in the file.
190191 */
@@ -197,6 +198,7 @@ static bool git_mwindow_scan_recently_used(
197198{
198199 git_mwindow * w , * w_last ;
199200 git_mwindow * lru_window = NULL , * lru_last = NULL ;
201+ bool found = false;
200202
201203 assert (mwf );
202204 assert (out_window );
@@ -223,10 +225,11 @@ static bool git_mwindow_scan_recently_used(
223225 (comparison_sign == GIT_MWINDOW__MRU && lru_window -> last_used < w -> last_used )) {
224226 lru_window = w ;
225227 lru_last = w_last ;
228+ found = true;
226229 }
227230 }
228231
229- if (!lru_window && ! lru_last )
232+ if (!found )
230233 return false;
231234
232235 * out_window = lru_window ;
You can’t perform that action at this time.
0 commit comments