Skip to content

Commit

Permalink
- Performance optimization 20% faster, 14% memory savings on set cell…
Browse files Browse the repository at this point in the history
… values;

- Using the canonical syntax in issue template and contributing guide;
- go test has been updated
  • Loading branch information
xuri committed May 15, 2018
1 parent 167554b commit d96440e
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 19 deletions.
6 changes: 2 additions & 4 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,17 @@ Briefly describe the problem you are having in a few paragraphs.

**Describe the results you received:**


**Describe the results you expected:**


**Output of `go version`:**

```
```text
(paste your output here)
```

**Excelize version or commit ID:**

```
```text
(paste here)
```

Expand Down
19 changes: 9 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ Security reports are greatly appreciated and we will publicly thank you for it.
We currently do not offer a paid security bounty program, but are not
ruling it out in the future.


## Reporting other issues

A great way to contribute to the project is to send a detailed report when you
Expand All @@ -44,7 +43,7 @@ When reporting issues, always include the output of `go env`.

Also include the steps required to reproduce the problem if possible and
applicable. This information will help us review and fix your issue faster.
When sending lengthy log-files, consider posting them as a gist (https://gist.github.com).
When sending lengthy log-files, consider posting them as a gist [https://gist.github.com](https://gist.github.com).
Don't forget to remove sensitive data from your logfiles before posting (you can
replace those parts with "REDACTED").

Expand Down Expand Up @@ -77,9 +76,9 @@ However, there might be a way to implement that feature *on top of* excelize.

Fork the repository and make changes on your fork in a feature branch:

- If it's a bug fix branch, name it XXXX-something where XXXX is the number of
* If it's a bug fix branch, name it XXXX-something where XXXX is the number of
the issue.
- If it's a feature branch, create an enhancement issue to announce
* If it's a feature branch, create an enhancement issue to announce
your intentions, and name it XXXX-something where XXXX is the number of the
issue.

Expand Down Expand Up @@ -194,7 +193,7 @@ signature certifies that you wrote the patch or otherwise have the right to pass
it on as an open-source patch. The rules are pretty simple: if you can certify
the below (from [developercertificate.org](http://developercertificate.org/)):

```
```text
Developer Certificate of Origin
Version 1.1
Expand Down Expand Up @@ -242,14 +241,14 @@ Use your real name (sorry, no pseudonyms or anonymous contributions.)
If you set your `user.name` and `user.email` git configs, you can sign your
commit automatically with `git commit -s`.

### How can I become a maintainer?
### How can I become a maintainer

First, all maintainers have 3 things

- They share responsibility in the project's success.
- They have made a long-term, recurring time investment to improve the project.
- They spend that time doing whatever needs to be done, not necessarily what
is the most interesting or fun.
* They share responsibility in the project's success.
* They have made a long-term, recurring time investment to improve the project.
* They spend that time doing whatever needs to be done, not necessarily what
is the most interesting or fun.

Maintainers are often under-appreciated, because their work is harder to appreciate.
It's easy to appreciate a really cool and technically advanced feature. It's harder
Expand Down
3 changes: 3 additions & 0 deletions excelize_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ func TestOpenFile(t *testing.T) {
xlsx.SetCellValue("Sheet2", "F17", complex64(5+10i))
t.Log(letterOnlyMapF('x'))
t.Log(deepCopy(nil, nil))
shiftJulianToNoon(1, -0.6)
timeFromExcelTime(61, true)
timeFromExcelTime(62, true)
// Test boolean write
booltest := []struct {
value bool
Expand Down
20 changes: 15 additions & 5 deletions sheet.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,15 @@ func (f *File) worksheetWriter() {

// trimCell provides function to trim blank cells which created by completeCol.
func trimCell(column []xlsxC) []xlsxC {
col := []xlsxC{}
col := make([]xlsxC, len(column))
i := 0
for _, c := range column {
if c.S != 0 || c.V != "" || c.F != nil || c.T != "" {
col = append(col, c)
col[i] = c
i++
}
}
return col
return col[0:i]
}

// Read and update property of contents type of XLSX.
Expand Down Expand Up @@ -641,8 +643,16 @@ func (f *File) GetSheetVisible(name string) bool {
// trimSheetName provides function to trim invaild characters by given worksheet
// name.
func trimSheetName(name string) string {
r := strings.NewReplacer(":", "", "\\", "", "/", "", "?", "", "*", "", "[", "", "]", "")
name = r.Replace(name)
r := []rune{}
for _, v := range []rune(name) {
switch v {
case 58, 92, 47, 63, 42, 91, 93: // replace :\/?*[]
continue
default:
r = append(r, v)
}
}
name = string(r)
if utf8.RuneCountInString(name) > 31 {
name = string([]rune(name)[0:31])
}
Expand Down

0 comments on commit d96440e

Please sign in to comment.