Ticket #5652: bug5652-perf-opt.diff

File bug5652-perf-opt.diff, 833 bytes (added by Daniel Aarno <macbishop@…>, 11 years ago)

Performance optimized patch for bug 5652: Check if file is symbolic link before stat:ing it during recursion (an not the other way around) but first check if we are following symlinks

  • operations.hpp

     
    689689    {
    690690      if ((m_options & symlink_option::_detail_no_push) == symlink_option::_detail_no_push)
    691691        m_options &= ~symlink_option::_detail_no_push;
    692       else if (is_directory(m_stack.top()->status())
    693         && (!is_symlink(m_stack.top()->symlink_status())
    694             || (m_options & symlink_option::recurse) == symlink_option::recurse))
     692      else if (((m_options & symlink_option::recurse) == symlink_option::recurse
     693                || !is_symlink(m_stack.top()->symlink_status()))
     694               && is_directory(m_stack.top()->status()))
    695695      {
     696
    696697        if (ec == 0)
    697698          m_stack.push(directory_iterator(m_stack.top()->path()));
    698699        else