Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f66cc45

Browse filesBrowse files
authored
fix: faster diff (#539)
1 parent f4fa069 commit f66cc45
Copy full SHA for f66cc45

File tree

Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed

‎functions/diff.js

Copy file name to clipboardExpand all lines: functions/diff.js
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ const parse = require('./parse')
22
const eq = require('./eq')
33

44
const diff = (version1, version2) => {
5-
if (eq(version1, version2)) {
5+
const v1 = parse(version1)
6+
const v2 = parse(version2)
7+
if (eq(v1, v2)) {
68
return null
79
} else {
8-
const v1 = parse(version1)
9-
const v2 = parse(version2)
1010
const hasPre = v1.prerelease.length || v2.prerelease.length
1111
const prefix = hasPre ? 'pre' : ''
1212
const defaultResult = hasPre ? 'prerelease' : ''

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.