foldfelis / foldfelis/DisplayStructure.jl

minor advice: this loop can be remove by array operations.

Open
#7 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
10
Forks
0
PR merge metrics
No merged PRs in 30d

Description

For loops' performance [here](https://github.com/foldfelis/DisplayStructure.jl/blob/b7fc09d3cf4326579bef6a3e3771f344ef8cd60f/src/display_row.jl#L40), [here](https://github.com/foldfelis/DisplayStructure.jl/blob/b7fc09d3cf4326579bef6a3e3771f344ef8cd60f/src/display_row.jl#L48), and [here](https://github.com/foldfelis/DisplayStructure.jl/blob/b7fc09d3cf4326579bef6a3e3771f344ef8cd60f/src/display_row.jl#L62), can be accelerated.

minor advice: this loop can be remove by array operations.
for example
```jl
len = index.pre + index.post + 1
old_len = length(row.context)
new_len = old_len + len
resize!(row.context, new_len)
copyto!(row.context, index.i + len, row.context, index.i, old_len - index.i + 1)
fill!(@view(row.context[index.i:index.i+len]), row.background)
```
(correctness need to be checked)

_Originally posted by @chengchingwen in #3

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.