Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
b1317e9f
Commit
b1317e9f
authored
May 13, 2004
by
bugreport%peshkin.net
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 226411: make DiffStrings handle fields with duplicate values
patch by jouni r=joel,myk a=justdave
parent
4f7b9f55
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
globals.pl
globals.pl
+13
-13
No files found.
globals.pl
View file @
b1317e9f
...
...
@@ -1404,20 +1404,20 @@ sub DiffStrings {
my
@old
=
split
(
" "
,
$oldstr
);
my
@new
=
split
(
" "
,
$newstr
);
my
(
@remove
,
@add
)
=
();
# Find values that were removed
foreach
my
$value
(
@old
)
{
push
(
@remove
,
$value
)
if
!
grep
(
$_
eq
$value
,
@new
);
}
# Find values that were added
foreach
my
$value
(
@new
)
{
push
(
@add
,
$value
)
if
!
grep
(
$_
eq
$value
,
@old
);
# For each pair of (old, new) entries:
# If they're equal, set them to empty. When done, @old contains entries
# that were removed; @new contains ones that got added.
foreach
my
$oldv
(
@old
)
{
foreach
my
$newv
(
@new
)
{
next
if
(
$newv
eq
''
);
if
(
$oldv
eq
$newv
)
{
$newv
=
$oldv
=
''
;
}
}
}
my
$removed
=
join
(
", "
,
@remove
);
my
$added
=
join
(
", "
,
@add
);
my
$removed
=
join
(
", "
,
grep
{
$_
ne
''
}
@old
);
my
$added
=
join
(
", "
,
grep
{
$_
ne
''
}
@new
);
return
(
$removed
,
$added
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment