[master] ed418ea0a modernize enum handling

Nils Goroll nils.goroll at uplex.de
Wed Apr 24 15:03:07 UTC 2019


commit ed418ea0a9916c1bac058eb23a48ea6f81b3a18d
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Wed Apr 24 16:41:59 2019 +0200

    modernize enum handling

diff --git a/lib/libvmod_vtc/vmod_vtc.c b/lib/libvmod_vtc/vmod_vtc.c
index b4022e869..c0620bd72 100644
--- a/lib/libvmod_vtc/vmod_vtc.c
+++ b/lib/libvmod_vtc/vmod_vtc.c
@@ -131,13 +131,13 @@ static struct ws *
 vtc_ws_find(VRT_CTX, VCL_ENUM which)
 {
 
-	if (!strcmp(which, "client"))
+	if (which == VENUM(client))
 		return (ctx->ws);
-	if (!strcmp(which, "backend"))
+	if (which == VENUM(backend))
 		return (ctx->bo->ws);
-	if (!strcmp(which, "session"))
+	if (which == VENUM(session))
 		return (ctx->req->sp->ws);
-	if (!strcmp(which, "thread"))
+	if (which == VENUM(thread))
 		return (ctx->req->wrk->aws);
 	WRONG("vtc_ws_find Illegal enum");
 }


More information about the varnish-commit mailing list