Optimize for-loop iteration: exit early when httpOnly is true

Optimize for-loop iteration: exit early when httpOnly is true

```
	for _, sctx := range e.sctxs {
		if sctx.httpOnly {
			splitHTTP = true
			break
		}
	}
```

Signed-off-by: cfanbo <haohtml@gmail.com>
This commit is contained in:
cfanbo 2024-09-05 20:57:04 +08:00
parent 4a11ca6c89
commit 3f082f5a68
No known key found for this signature in database
GPG Key ID: 675C56014A6755DC

View File

@ -767,6 +767,7 @@ func (e *Etcd) serveClients() {
for _, sctx := range e.sctxs { for _, sctx := range e.sctxs {
if sctx.httpOnly { if sctx.httpOnly {
splitHTTP = true splitHTTP = true
break
} }
} }