Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

path: refactor for performance and consistency #1778

Closed
wants to merge 2 commits into from
Closed

path: refactor for performance and consistency #1778

wants to merge 2 commits into from

Commits on Jul 3, 2015

  1. path: refactor for performance and consistency

    Improve performance by:
    + Not leaking the `arguments` object!
    + Getting the last character of a string by index, instead of
      with `.substr()` or `.slice()`
    
    Improve code consistency by:
    + Using `[]` instead of `.charAt()` where possible
    + Using a function declaration instead of a var declaration
    + Using `.slice()` with clearer arguments
    + Checking if `dir` is truthy in `win32.format`
      (added tests for this)
    
    Improve both by:
    + Making the reusable `trimArray()` function
    + Standardizing getting certain path statistics with
      the new `win32StatPath()` function
    nwoltman committed Jul 3, 2015
    Configuration menu
    Copy the full SHA
    84e4f5b View commit details
    Browse the repository at this point in the history
  2. benchmark: Add some path benchmarks for #1778

    Path functions being benchmarked are:
    * format
    * isAbsolute
    * join
    * normalize
    * relative
    * resolve
    nwoltman committed Jul 3, 2015
    Configuration menu
    Copy the full SHA
    363335c View commit details
    Browse the repository at this point in the history