Skip to content
This repository was archived by the owner on Mar 24, 2026. It is now read-only.

[swift-nio] use add instead of replaceOrAdd - #4176

Merged
NateBrady23 merged 1 commit into
TechEmpower:masterfrom
tanner0101:patch-1
Nov 5, 2018
Merged

NateBrady23 merged 1 commit into
TechEmpower:masterfrom
tanner0101:patch-1

Conversation

@tanner0101

Copy link
Copy Markdown
Contributor

This is a small performance improvement for the Swift / Swift-NIO benchmark. replaceOrAdd does an unnecessary scan to check if the header already exists. This code is clearly creating an empty headers array before adding the values, so we can be sure we do not need to replace any existing values.

@NateBrady23
NateBrady23 merged commit c4b9277 into TechEmpower:master Nov 5, 2018
roberthusak pushed a commit to roberthusak/FrameworkBenchmarks that referenced this pull request Nov 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants