shithub: pdffs

Download patch

ref: 722d214beafe9907b9c44b4046c0378a2c29e1d2
parent: c0f0f0d63588d1d8ad1492d053eef211e4399cbd
author: Noam Preil <[email protected]>
date: Fri Apr 8 09:01:56 EDT 2022

dictget: remove impossible branch

--- a/dict.c
+++ b/dict.c
@@ -72,12 +72,9 @@
 	o = pdfeval(o);
 	if((o->type != Ostream && o->type != Odict) || name == nil)
 		return &null;
-	for(i = 0; i < o->dict.nkv; i++){
-		if(strcmp(name, o->dict.kv[i].key) == 0){
-			o = pdfeval(i < o->dict.nkv ? o->dict.kv[i].value : nil);
-			return o;
-		}
-	}
+	for(i = 0; i < o->dict.nkv; i++)
+		if(strcmp(name, o->dict.kv[i].key) == 0)
+			return pdfeval(o->dict.kv[i].value);
 
 	return &null;
 }