Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
d92a161c
Commit
d92a161c
authored
Nov 05, 2013
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttp2_hd_huffman: Code cleanup
parent
bc347d6b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
lib/nghttp2_hd_huffman.c
lib/nghttp2_hd_huffman.c
+7
-6
No files found.
lib/nghttp2_hd_huffman.c
View file @
d92a161c
...
...
@@ -100,20 +100,21 @@ static uint8_t huff_get_lsb_aligned(const nghttp2_huff_sym *sym,
size_t
codebitoff
,
size_t
nbits
)
{
uint8_t
a
=
sym
->
code
[
codebitoff
/
8
];
size_t
codeidx
=
codebitoff
/
8
;
uint8_t
a
=
sym
->
code
[
codeidx
];
size_t
localbitoff
=
codebitoff
&
0x7
;
size_t
bitleft
=
8
-
localbitoff
;
if
(
bitleft
>=
nbits
)
{
return
(
a
>>
(
bitleft
-
nbits
))
&
((
1
<<
nbits
)
-
1
);
}
else
{
uint8_t
b
=
0
;
size_t
right
=
nbits
-
bitleft
;
a
&=
((
1
<<
bitleft
)
-
1
);
a
<<=
nbits
-
bitlef
t
;
if
((
sym
->
nbits
+
7
)
/
8
>
code
bitoff
/
8
+
1
)
{
b
=
sym
->
code
[
codebitoff
/
8
+
1
]
>>
(
8
-
(
nbits
-
bitleft
)
);
a
<<=
righ
t
;
if
((
sym
->
nbits
+
7
)
/
8
>
code
idx
+
1
)
{
a
|=
sym
->
code
[
codeidx
+
1
]
>>
(
8
-
right
);
}
return
a
|
b
;
return
a
;
}
}
...
...
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