Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
a926d4fe
Unverified
Commit
a926d4fe
authored
Aug 20, 2021
by
James Lamb
Committed by
GitHub
Aug 19, 2021
Browse files
consolidate duplicate conditions in TextReader (#4530)
parent
981853b1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
include/LightGBM/utils/text_reader.h
include/LightGBM/utils/text_reader.h
+5
-3
No files found.
include/LightGBM/utils/text_reader.h
View file @
a926d4fe
...
...
@@ -198,8 +198,10 @@ class TextReader {
[
&
filter_fun
,
&
out_used_data_indices
,
this
]
(
INDEX_T
line_idx
,
const
char
*
buffer
,
size_t
size
)
{
bool
is_used
=
filter_fun
(
line_idx
);
if
(
is_used
)
{
out_used_data_indices
->
push_back
(
line_idx
);
}
if
(
is_used
)
{
lines_
.
emplace_back
(
buffer
,
size
);
}
if
(
is_used
)
{
out_used_data_indices
->
push_back
(
line_idx
);
lines_
.
emplace_back
(
buffer
,
size
);
}
});
return
total_cnt
;
}
...
...
@@ -213,8 +215,8 @@ class TextReader {
&
out_sampled_data
]
(
INDEX_T
line_idx
,
const
char
*
buffer
,
size_t
size
)
{
bool
is_used
=
filter_fun
(
line_idx
);
if
(
is_used
)
{
out_used_data_indices
->
push_back
(
line_idx
);
}
if
(
is_used
)
{
out_used_data_indices
->
push_back
(
line_idx
);
if
(
cur_sample_cnt
<
sample_cnt
)
{
out_sampled_data
->
emplace_back
(
buffer
,
size
);
++
cur_sample_cnt
;
...
...
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