Eliminate silly leftover switch-case from _tagType()
authorPanu Matilainen <pmatilai@redhat.com>
Tue, 28 Sep 2010 19:47:44 +0000 (22:47 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Tue, 28 Sep 2010 19:47:44 +0000 (22:47 +0300)
- Anybody calling rpmTagGetType() with RPMDBI_PACKAGES deserves to
  wait for the search to figure there's no such thing and return
  RPM_NULL_TYPE like with the switch case. Eliminates another
  enum comparison mismatch warning.

lib/tagname.c

index 40e7f7a..c847728 100644 (file)
@@ -177,13 +177,7 @@ static rpmTagType _tagType(rpmTag tag)
 
     if (_rpmTags.byValue == NULL)
        xx = tagLoadIndex(&_rpmTags.byValue, &_rpmTags.byValueSize, tagCmpValue);
-
-    switch (tag) {
-    case RPMDBI_PACKAGES:
-       break;
-    default:
-       if (_rpmTags.byValue == NULL)
-           break;
+    if (_rpmTags.byValue) {
        l = 0;
        u = _rpmTags.byValueSize;
        while (l < u) {
@@ -206,7 +200,6 @@ static rpmTagType _tagType(rpmTag tag)
                return (rpmTagType)(t->type | t->retype);
            }
        }
-       break;
     }
     return RPM_NULL_TYPE;
 }