Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: nodejs/node
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 410eb97bcea9bf8fb15c1b980a19c3a8daaa6824
Choose a base ref
...
head repository: nodejs/node
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0fd5b458bec739eb8b4cea4dc362a36eb3e61fde
Choose a head ref
  • 8 commits
  • 1 file changed
  • 1 contributor

Commits on Mar 1, 2019

  1. path: minor refactoring

    1) This uses some ternary expressions instead of if else to assign
       some variables.
    2) Use template strings instead of concat.
    3) Use the object shortand notation.
    4) Some var to let / const.
    5) Removed some double line breaks.
    6) Less brackets around statements if not necessary.
    
    PR-URL: #25278
    Reviewed-By: Michaël Zasso <targos@protonmail.com>
    BridgeAR committed Mar 1, 2019
    Configuration menu
    Copy the full SHA
    05a8dbc View commit details
    Browse the repository at this point in the history
  2. path: more small refactorings

    1) Refactor for loops to while loops that were only meant to count
       up a variable.
    2) Refactor some `var` statements to `let` / `const`.
    3) Simplify return conditions.
    4) Use template strings where possible instead of concat.
    5) Use ternary expressions for variable assignments instead of
       if / else.
    6) Use the object shorthand notation for the function declarations.
    7) Consolidate if else case where possible.
    8) Remove double line breaks.
    
    PR-URL: #25278
    Reviewed-By: Michaël Zasso <targos@protonmail.com>
    BridgeAR committed Mar 1, 2019
    Configuration menu
    Copy the full SHA
    9d19b1f View commit details
    Browse the repository at this point in the history
  3. path: refactor more path code for simplicity

    1) Consolidate format to a single function.
    2) Move some code that can only be reached in some code branches
       that was formerly executed in all cases.
    3) Explicitly check for the string length of zero instead of
       converting the string to a boolean.
    4) Consolidate nested if statements if possible e.g.,
         if (foo) { if (bar) { /* do stuff */ } }
       to reduce indentation depth.
    5) Simplify checks by removing extra length checks when comparing
       two strings.
    6) Use object shorthand notation where possible.
    
    PR-URL: #25278
    Reviewed-By: Michaël Zasso <targos@protonmail.com>
    BridgeAR committed Mar 1, 2019
    Configuration menu
    Copy the full SHA
    a019d7b View commit details
    Browse the repository at this point in the history
  4. path: minor refactoring

    1) Consolidate nested if statements if possible
         `if (foo) { if bar () { /* do stuff */ } }`)
       to reduce indentation depth.
    2) Remove obsolete else cases to reduce indentation.
    
    PR-URL: #25278
    Reviewed-By: Michaël Zasso <targos@protonmail.com>
    BridgeAR committed Mar 1, 2019
    Configuration menu
    Copy the full SHA
    f59fdd9 View commit details
    Browse the repository at this point in the history
  5. path: refactor logic for to reduce code branches

    This refactoring makes sure some code branches will not be hit if
    they do not have to be reached.
    
    PR-URL: #25278
    Reviewed-By: Michaël Zasso <targos@protonmail.com>
    BridgeAR committed Mar 1, 2019
    Configuration menu
    Copy the full SHA
    e750e95 View commit details
    Browse the repository at this point in the history
  6. path: simplify code and remove obsolete checks

    Either `end` is `-1` or `startPart` is not `0`. Therefore it's
    possible to move the conditions in a way that we eliminate a few code
    branches.
    
    PR-URL: #25278
    Reviewed-By: Michaël Zasso <targos@protonmail.com>
    BridgeAR committed Mar 1, 2019
    Configuration menu
    Copy the full SHA
    e68b0d6 View commit details
    Browse the repository at this point in the history
  7. path: refactor for less indentation

    This moves the `if (len === 1)` case to the top of the function.
    That way it is possible to reduce the indentation level due to
    returning early in that case.
    
    On top of that the following was done:
    
    1) For clarity refactored for loops which were meant to count up a
       variable into a while loop.
    2) Used template strings instead of string concat.
    3) Consolidating nested if statements.
    4) Using tenary expressions if applicable when assigning variables
       to reduce the code overhead.
    
    PR-URL: #25278
    Reviewed-By: Michaël Zasso <targos@protonmail.com>
    BridgeAR committed Mar 1, 2019
    Configuration menu
    Copy the full SHA
    7cbe29e View commit details
    Browse the repository at this point in the history
  8. path: refactor code for clarity

    This moves a condition inside of a for loop which can only be
    triggered at the very end of the for loop outside of the loop. That
    way the for loop itself is much simpler and easier to understand and
    the code itself is less indented which should increase the
    readability.
    
    It also refactors some `var` to `let` and `const`.
    
    PR-URL: #25278
    Reviewed-By: Michaël Zasso <targos@protonmail.com>
    BridgeAR committed Mar 1, 2019
    Configuration menu
    Copy the full SHA
    0fd5b45 View commit details
    Browse the repository at this point in the history
Loading