Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Magisk
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Magisk
Commits
a6e76802
Commit
a6e76802
authored
May 09, 2019
by
Viktor De Pasquale
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed logs being bugged down by unreliable code
parent
e79e744e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
16 deletions
+2
-16
LogRepository.kt
...ava/com/topjohnwu/magisk/data/repository/LogRepository.kt
+2
-16
No files found.
app/src/main/java/com/topjohnwu/magisk/data/repository/LogRepository.kt
View file @
a6e76802
...
...
@@ -33,22 +33,8 @@ class LogRepository(
private
fun
List
<
MagiskLog
>.
wrap
():
List
<
WrappedMagiskLog
>
{
val
day
=
TimeUnit
.
DAYS
.
toMillis
(
1
)
var
currentDay
=
firstOrNull
()
?.
date
?.
time
?:
return
listOf
()
var
tempList
=
this
val
outList
=
mutableListOf
<
WrappedMagiskLog
>()
while
(
tempList
.
isNotEmpty
())
{
val
logsGivenDay
=
takeWhile
{
it
.
date
.
time
/
day
==
currentDay
/
day
}
currentDay
=
tempList
.
firstOrNull
()
?.
date
?.
time
?:
currentDay
+
day
if
(
logsGivenDay
.
isEmpty
())
continue
outList
.
add
(
WrappedMagiskLog
(
currentDay
/
day
*
day
,
logsGivenDay
))
tempList
=
tempList
.
subList
(
logsGivenDay
.
size
,
tempList
.
size
)
}
return
outList
return
groupBy
{
it
.
date
.
time
/
day
}
.
map
{
WrappedMagiskLog
(
it
.
key
*
day
,
it
.
value
)
}
}
...
...
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