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
90ffe1c9
Commit
90ffe1c9
authored
Nov 01, 2016
by
Allard van Mossel
Committed by
Guolin Ke
Nov 01, 2016
Browse files
Fixed bug where reads could be attempted in an index > read_cnt (#57)
parent
a194045c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
include/LightGBM/utils/text_reader.h
include/LightGBM/utils/text_reader.h
+3
-3
No files found.
include/LightGBM/utils/text_reader.h
View file @
90ffe1c9
...
@@ -112,7 +112,7 @@ public:
...
@@ -112,7 +112,7 @@ public:
++
i
;
++
i
;
++
total_cnt
;
++
total_cnt
;
// skip end of line
// skip end of line
while
(
buffer_process
[
i
]
==
'\n'
||
buffer_process
[
i
]
==
'\r'
)
{
++
i
;
}
while
(
(
buffer_process
[
i
]
==
'\n'
||
buffer_process
[
i
]
==
'\r'
)
&&
i
<
read_cnt
)
{
++
i
;
}
last_i
=
i
;
last_i
=
i
;
}
}
else
{
else
{
...
@@ -247,7 +247,7 @@ public:
...
@@ -247,7 +247,7 @@ public:
++
i
;
++
i
;
++
total_cnt
;
++
total_cnt
;
// skip end of line
// skip end of line
while
(
buffer_process
[
i
]
==
'\n'
||
buffer_process
[
i
]
==
'\r'
)
{
++
i
;
}
while
(
(
buffer_process
[
i
]
==
'\n'
||
buffer_process
[
i
]
==
'\r'
)
&&
i
<
read_cnt
)
{
++
i
;
}
last_i
=
i
;
last_i
=
i
;
}
}
else
{
else
{
...
@@ -281,7 +281,7 @@ public:
...
@@ -281,7 +281,7 @@ public:
}
}
INDEX_T
ReadPartAndProcessParallel
(
const
std
::
vector
<
INDEX_T
>&
used_data_indices
,
const
std
::
function
<
void
(
INDEX_T
,
const
std
::
vector
<
std
::
string
>&
)
>&
process_fun
)
{
INDEX_T
ReadPartAndProcessParallel
(
const
std
::
vector
<
INDEX_T
>&
used_data_indices
,
const
std
::
function
<
void
(
INDEX_T
,
const
std
::
vector
<
std
::
string
>&
)
>&
process_fun
)
{
return
ReadAllAndProcessParallelWithFilter
(
process_fun
,
return
ReadAllAndProcessParallelWithFilter
(
process_fun
,
[
&
used_data_indices
](
INDEX_T
used_cnt
,
INDEX_T
total_cnt
)
{
[
&
used_data_indices
](
INDEX_T
used_cnt
,
INDEX_T
total_cnt
)
{
if
(
used_cnt
<
used_data_indices
.
size
()
&&
total_cnt
==
used_data_indices
[
used_cnt
])
{
if
(
used_cnt
<
used_data_indices
.
size
()
&&
total_cnt
==
used_data_indices
[
used_cnt
])
{
return
true
;
return
true
;
...
...
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