vim-patch:8.1.0623: iterating through window frames is repeated

Problem:    Iterating through window frames is repeated.
Solution:   Define FOR_ALL_FRAMES. (Yegappan Lakshmanan)
3d1491ed23
This commit is contained in:
Jan Edmund Lazo
2019-07-12 23:24:28 -04:00
parent 1c2cfdba88
commit e95945a157
4 changed files with 120 additions and 92 deletions

View File

@@ -9323,26 +9323,30 @@ static frame_T *ses_skipframe(frame_T *fr)
{
frame_T *frc;
for (frc = fr; frc != NULL; frc = frc->fr_next)
if (ses_do_frame(frc))
FOR_ALL_FRAMES(frc, fr) {
if (ses_do_frame(frc)) {
break;
}
}
return frc;
}
/*
* Return TRUE if frame "fr" has a window somewhere that we want to save in
* the Session.
*/
static int ses_do_frame(frame_T *fr)
// Return true if frame "fr" has a window somewhere that we want to save in
// the Session.
static bool ses_do_frame(const frame_T *fr)
FUNC_ATTR_NONNULL_ARG(1)
{
frame_T *frc;
const frame_T *frc;
if (fr->fr_layout == FR_LEAF)
if (fr->fr_layout == FR_LEAF) {
return ses_do_win(fr->fr_win);
for (frc = fr->fr_child; frc != NULL; frc = frc->fr_next)
if (ses_do_frame(frc))
return TRUE;
return FALSE;
}
FOR_ALL_FRAMES(frc, fr->fr_child) {
if (ses_do_frame(frc)) {
return true;
}
}
return false;
}
/// Return non-zero if window "wp" is to be stored in the Session.