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
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
globals.pl
globals.pl
+11
-11
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
)
=
();
# 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.
# Find values that were removed
foreach
my
$value
(
@old
)
{
push
(
@remove
,
$value
)
if
!
grep
(
$_
eq
$value
,
@new
);
foreach
my
$oldv
(
@old
)
{
foreach
my
$newv
(
@new
)
{
next
if
(
$newv
eq
''
);
if
(
$oldv
eq
$newv
)
{
$newv
=
$oldv
=
''
;
}
# Find values that were added
foreach
my
$value
(
@new
)
{
push
(
@add
,
$value
)
if
!
grep
(
$_
eq
$value
,
@old
);
}
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