Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

list: ArrayList Delete 方法缩容(issue#59) #63

Merged
merged 15 commits into from
Sep 1, 2022

Conversation

mousseqin
Copy link
Contributor

实现ArrayList Delete 方法缩容

@codecov
Copy link

codecov bot commented Sep 1, 2022

Codecov Report

Merging #63 (4f8f4ff) into dev (2432411) will increase coverage by 5.21%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##              dev      #63      +/-   ##
==========================================
+ Coverage   89.50%   94.71%   +5.21%     
==========================================
  Files          12       12              
  Lines         524      700     +176     
==========================================
+ Hits          469      663     +194     
+ Misses         47       29      -18     
  Partials        8        8              
Impacted Files Coverage Δ
list/array_list.go 96.42% <100.00%> (+4.36%) ⬆️
pool/task_pool.go 100.00% <100.00%> (+100.00%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Contributor

@flycash flycash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

在 changelog 里面记录一下这个合并请求。

return res, nil
}

// arrShrinkage 数组缩容
func (a *ArrayList[T]) arrShrinkage() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

直接叫做 shrink 就可以了

list/array_list.go Show resolved Hide resolved
list/array_list.go Outdated Show resolved Hide resolved
list/array_list_test.go Outdated Show resolved Hide resolved
@mousseqin
Copy link
Contributor Author

commit_id:4f8f4ffbeb729259b75fdb9c312f2513c16cace3优化内容
1.修改changelog.md
2.方法名改为shrink
3.delete方法中去除判断,把所有判断放入shrink方法
4.复制切片时,直接make一个切片而不是new一个arraylist
5.完善array_list_test文件中TestArrayList_Delete_Shrink方法。测试用例改为tdd方式,并新增逻辑测试和边界测试两大块内容。

@flycash flycash linked an issue Sep 1, 2022 that may be closed by this pull request
@flycash flycash merged commit 91bbf2b into ecodeclub:dev Sep 1, 2022
@mousseqin mousseqin deleted the issue#59 branch September 2, 2022 14:52
flycash pushed a commit that referenced this pull request Sep 11, 2022
* issue#59list: ArrayList Delete 方法缩容
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

list: ArrayList Delete 方法缩容
2 participants