You can do

```c
if (wipe_buf) {
  wipe_buf(buf);
} else if (del_buf) {
  delete_buffer(buf);  // <---- this should include a call to
buf_clear_file(buf)
} else {
  buf_clear_file(buf);
}
```


On Thu, Apr 24, 2014 at 4:29 AM, Matthias Beyer <notifications@github.com>wrote:

> In src/buffer.c:
>
> > +  case 'u': /* 'bufhidden' == "unload" */
> > +    *unload = TRUE;
> > +    /* fallthrough */
> > +
> > +  }
> > +
> > +}
> > +
> > +/*
> > + * Remove the buffer from the list.
> > + */
> > +static void
> > +wipe_or_delete_buffer(int wipe_buf, int del_buf, buf_T *buf, buf_T *firstbuf,
> > +        buf_T *lastbuf)
> > +{
> > +  if (wipe_buf) {
>
> But if I'd move the if-else back to the called, the caller would contain
> partitial code from the if-else construct, as we do
>
> if (wipe_buf) {
>   /// code
> } else {
>   if (del_buf) {
>     /// code
>   }
>   /// something else
>   if (del_buf) /// more
> }
>
> Moving this to the caller would result in something like
>
> if (wipe_buf)
>   wipe_buf(buf);
> else {
>   if (del_buf)
>     del_buf(buf);
>   // something
>   if (del_buf)
>     // something more
> }
>
> which isn't really clean either!
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/neovim/neovim/pull/592/files#r11938178>
> .
>