mirror of
https://github.com/jarun/nnn.git
synced 2025-03-17 20:14:38 +00:00
Eliminate redundant stat()
This commit is contained in:
parent
6ba0a8357f
commit
88e38f1efc
1 changed files with 4 additions and 2 deletions
|
@ -1362,8 +1362,10 @@ static bool isselfileempty(void)
|
||||||
|
|
||||||
static int get_cur_or_sel(void)
|
static int get_cur_or_sel(void)
|
||||||
{
|
{
|
||||||
|
bool sel = (selbufpos || !isselfileempty());
|
||||||
|
|
||||||
/* Check both local buffer and selection file for external selection */
|
/* Check both local buffer and selection file for external selection */
|
||||||
if ((selbufpos || !isselfileempty()) && ndents) {
|
if (sel && ndents) {
|
||||||
/* If selection is preferred and we have a local selection, return selection.
|
/* If selection is preferred and we have a local selection, return selection.
|
||||||
* Always show the prompt in case of an external selection.
|
* Always show the prompt in case of an external selection.
|
||||||
*/
|
*/
|
||||||
|
@ -1375,7 +1377,7 @@ static int get_cur_or_sel(void)
|
||||||
return ((choice == 'c' || choice == 's') ? choice : 0);
|
return ((choice == 'c' || choice == 's') ? choice : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selbufpos || !isselfileempty())
|
if (sel)
|
||||||
return 's';
|
return 's';
|
||||||
|
|
||||||
if (ndents)
|
if (ndents)
|
||||||
|
|
Loading…
Add table
Reference in a new issue