[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nano-devel] [PATCH] browser: merging opendir() in to one

From: Rishabh Dave
Subject: [Nano-devel] [PATCH] browser: merging opendir() in to one
Date: Sat, 14 May 2016 19:21:42 +0530


First of all, everything is in context to the patch -
"merging-opendir.patch", except pt. 3.

All instances of opendir() - 3 in do_browser() and 1 in
do_browse_from() - are merged, melted into one. However, I couldn't
create absolutely single instance of opendir() as if target path
fails, older path has to be opened. Otherwise, I feel code looks much
better now.

I have following questions -

1. 'kbinput = KEY_WINCH' is to keep the content of window when window
size changes, right? I was able to get rid of opendir() under the 'if
(kbinput == KEY_WINCH)' and did not find any effect with current
arrangement of code. Maybe, I was looking in wrong direction so didn't
find any bug.

2. I have removed newline between goto statements and preceding
statements as they look like single logical unit:
make-preparation-and-goto-read_browser_directory. But, maybe, someone
reading hastily might miss it. So newline should removed or kept... or
the question is too trivial?

3. This one is in context to patch
"merging-opendir-slimmer-but-crude.patch". In last moment, I realized
re-entering in previous directory is redundant when we encounter an
error. Previous directory is already open, we only need to wait for
options. Is that flow better? We would need to remove. at least, one
goto statement, right? This one has truly single instance of

By the way, re-structuring code is more fun! :D

Attachment: merging-opendir-slimmer-but-crude.patch
Description: Text Data

Attachment: merging-opendir.patch
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]