Commit b9eddeab authored by Vincent Lefevre's avatar Vincent Lefevre

Cleanup: avoid an ugly local preprocessor macro.

Note: This macro was also hiding the use of a variable, making the code
difficult to read.
parent 1d41321a
Pipeline #26238781 passed with stages
in 14 minutes and 43 seconds
......@@ -434,7 +434,6 @@ static void update_index_unthreaded (CONTEXT *ctx, int check, int oldcount)
* they will be visible in the limited view */
if (ctx->pattern)
{
#define THIS_BODY ctx->hdrs[j]->content
for (j = (check == MUTT_REOPENED) ? 0 : oldcount; j < ctx->msgcount; j++)
{
if (!j)
......@@ -444,15 +443,16 @@ static void update_index_unthreaded (CONTEXT *ctx, int check, int oldcount)
MUTT_MATCH_FULL_ADDRESS,
ctx, ctx->hdrs[j], NULL))
{
BODY *this_body = ctx->hdrs[j]->content;
assert (ctx->vcount < ctx->msgcount);
ctx->hdrs[j]->virtual = ctx->vcount;
ctx->v2r[ctx->vcount] = j;
ctx->hdrs[j]->limited = 1;
ctx->vcount++;
ctx->vsize += THIS_BODY->length + THIS_BODY->offset - THIS_BODY->hdr_offset;
ctx->vsize += this_body->length + this_body->offset - this_body->hdr_offset;
}
}
#undef THIS_BODY
}
/* if the mailbox was reopened, need to rethread from scratch */
......
......@@ -1475,8 +1475,6 @@ int mutt_pattern_func (int op, char *prompt)
MUTT_PROGRESS_MSG, ReadInc,
(op == MUTT_LIMIT) ? Context->msgcount : Context->vcount);
#define THIS_BODY Context->hdrs[i]->content
if (op == MUTT_LIMIT)
{
Context->vcount = 0;
......@@ -1493,12 +1491,14 @@ int mutt_pattern_func (int op, char *prompt)
Context->hdrs[i]->num_hidden = 0;
if (mutt_pattern_exec (pat, MUTT_MATCH_FULL_ADDRESS, Context, Context->hdrs[i], NULL))
{
BODY *this_body = Context->hdrs[i]->content;
Context->hdrs[i]->virtual = Context->vcount;
Context->hdrs[i]->limited = 1;
Context->v2r[Context->vcount] = i;
Context->vcount++;
Context->vsize+=THIS_BODY->length + THIS_BODY->offset -
THIS_BODY->hdr_offset;
Context->vsize += this_body->length + this_body->offset -
this_body->hdr_offset;
}
}
}
......@@ -1528,8 +1528,6 @@ int mutt_pattern_func (int op, char *prompt)
}
}
#undef THIS_BODY
mutt_clear_error ();
if (op == MUTT_LIMIT)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment