Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
ccan
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mirror
ccan
Commits
10db5dc0
Commit
10db5dc0
authored
Feb 20, 2016
by
Andrew Jeffery
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
strgrp: Shift constant out of loop
Likely this was optimised away, but the code now represents the intent.
parent
d23fb57c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
ccan/strgrp/strgrp.c
ccan/strgrp/strgrp.c
+1
-1
No files found.
ccan/strgrp/strgrp.c
View file @
10db5dc0
...
@@ -147,9 +147,9 @@ lcs(const char *const a, const char *const b) {
...
@@ -147,9 +147,9 @@ lcs(const char *const a, const char *const b) {
int
ia
,
ib
;
int
ia
,
ib
;
for
(
ia
=
(
strlen
(
a
)
-
1
);
ia
>=
0
;
ia
--
)
{
for
(
ia
=
(
strlen
(
a
)
-
1
);
ia
>=
0
;
ia
--
)
{
const
char
iav
=
a
[
ia
];
const
char
iav
=
a
[
ia
];
const
int
ial
=
(
ia
+
1
)
&
1
;
// ia last
for
(
ib
=
lb
-
1
;
ib
>=
0
;
ib
--
)
{
for
(
ib
=
lb
-
1
;
ib
>=
0
;
ib
--
)
{
const
char
ibv
=
b
[
ib
];
const
char
ibv
=
b
[
ib
];
const
int
ial
=
(
ia
+
1
)
&
1
;
// ia last
const
int
iac
=
ia
&
1
;
// ia current
const
int
iac
=
ia
&
1
;
// ia current
const
int
ibl
=
ib
+
1
;
// ib last
const
int
ibl
=
ib
+
1
;
// ib last
// don't need separate "ib current" as it's just ib
// don't need separate "ib current" as it's just ib
...
...
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