소스 검색

Code refatoring

master
Arun Prakash Jana 6 년 전
부모
커밋
af8c52b026
No known key found for this signature in database GPG 키 ID: A75979F35C080412
1개의 변경된 파일13개의 추가작업 그리고 7개의 파일을 삭제
  1. +13
    -7
      src/nnn.c

+ 13
- 7
src/nnn.c 파일 보기

@@ -1420,23 +1420,29 @@ static int nextsel(int *presel)
return 0;
}

static inline void swap_ent(int id1, int id2)
{
static struct entry _dent, *pdent1, *pdent2;;

pdent1 = &dents[id1];
pdent2 = &dents[id2];

*(&_dent) = *pdent1;
*pdent1 = *pdent2;
*pdent2 = *(&_dent);
}

/*
* Move non-matching entries to the end
*/
static int fill(char *fltr, regex_t *re)
{
static int count;
static struct entry _dent, *pdent1, *pdent2;

for (count = 0; count < ndents; ++count) {
if (filterfn(re, dents[count].name, fltr) == 0) {
if (count != --ndents) {
pdent1 = &dents[count];
pdent2 = &dents[ndents];

*(&_dent) = *pdent1;
*pdent1 = *pdent2;
*pdent2 = *(&_dent);
swap_ent(count, ndents);
--count;
}



불러오는 중...
취소
저장