1. 11 Aug, 2016 2 commits
    • Hisham Muhammad's avatar
      Merge pull request #537 from Explorer09/string-utils · d3f57526
      Hisham Muhammad authored
      Optimize Strings_startWith()
      d3f57526
    • Explorer09's avatar
      Optimize Strings_startWith() · bf35921a
      Explorer09 authored
      Use strncmp() combined with a strlen() will give better performance
      than a strstr in worst case. Especially when the match prefix is a
      constant and not a variable.
      
      While we are at it, replace the match() function in linux/Battery.c,
      which uses a naive algorithm, with a macro that does better job by
      utilizing Strings_startWith().
      
          $ gcc --version | head -n 1
          gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
          $ uname -m
          x86_64
          $ size htop.old htop.new
             text   data    bss    dec    hex filename
           137929  15112   3776 156817  26491 htop.old
           137784  15104   3776 156664  263f8 htop.new
      
      Signed-off-by: Kang-Che Sung <explorer09 @ gmail.com>
      bf35921a
  2. 09 Aug, 2016 1 commit
  3. 06 Aug, 2016 1 commit
    • Explorer09's avatar
      Fix scrolling behavior change caused by 759caf0f · 3d986883
      Explorer09 authored
      Commit "Make PgDown behavior more usual." 759caf0f
      silently changes the PageDown scrolling behavior that, instead of
      scrolling one window down until the end of the window touches the end
      of the list, the window simply repositions itself in a way that the
      selected item always become the last item in the new window.
      
      The commit reverts the behavior, and also fixes sanity conditionals
      so that the scrollV variable will _never_ become negative or out-of-
      bound.
      
      Fixes issue #532. Also keep the problem #480 addressed.
      
      Signed-off-by: Kang-Che Sung <explorer09 @ gmail.com>
      3d986883
  4. 28 Jul, 2016 2 commits
  5. 23 Jul, 2016 1 commit
  6. 22 Jul, 2016 1 commit
  7. 21 Jul, 2016 2 commits
  8. 12 Jul, 2016 1 commit
  9. 11 Jul, 2016 1 commit
  10. 23 Jun, 2016 1 commit
  11. 20 Jun, 2016 1 commit
  12. 19 Jun, 2016 3 commits
  13. 18 Jun, 2016 1 commit
  14. 17 Jun, 2016 2 commits
  15. 15 Jun, 2016 3 commits
  16. 04 Jun, 2016 1 commit
  17. 03 Jun, 2016 1 commit
  18. 02 Jun, 2016 3 commits
  19. 30 May, 2016 5 commits
  20. 27 May, 2016 2 commits
  21. 26 May, 2016 2 commits
  22. 25 May, 2016 1 commit
  23. 19 May, 2016 2 commits