Mark exif_tag_table_count as inline so uses within the file can be faster.
authorDan Fandrich <dan@coneharvesters.com>
Wed, 28 Oct 2009 22:36:50 +0000 (15:36 -0700)
committerDan Fandrich <dan@coneharvesters.com>
Wed, 28 Oct 2009 22:36:50 +0000 (15:36 -0700)
libexif/exif-tag.c

index ecd14d1..b3d59ac 100644 (file)
@@ -866,6 +866,17 @@ static const struct TagEntry {
 
 /* For now, do not use these functions. */
 
+/*!
+ * Return the number of entries in the EXIF tag table, including the
+ * terminating NULL entry.
+ */
+inline unsigned int
+exif_tag_table_count (void)
+{
+       return sizeof (ExifTagTable) / sizeof (ExifTagTable[0]);
+}
+
+
 ExifTag
 exif_tag_table_get_tag (unsigned int n)
 {
@@ -879,17 +890,6 @@ exif_tag_table_get_name (unsigned int n)
 }
 
 /*!
- * Return the number of entries in the EXIF tag table, including the
- * terminating NULL entry.
- */
-unsigned int
-exif_tag_table_count (void)
-{
-       return sizeof (ExifTagTable) / sizeof (ExifTagTable[0]);
-}
-
-
-/*!
  * Compares the tag with that in entry.
  * \param[in] tag pointer to integer tag value
  * \param[in] entry pointer to a struct TagEntry
@@ -913,9 +913,9 @@ exif_tag_table_first(ExifTag tag)
 {
        int i;
        struct TagEntry *entry = bsearch(&tag, ExifTagTable,
-                       exif_tag_table_count()-1, sizeof(struct TagEntry), match_tag);
+               exif_tag_table_count()-1, sizeof(struct TagEntry), match_tag);
        if (!entry)
-                       return -1;      /* Not found */
+               return -1;      /* Not found */
 
        /* Calculate index of found entry */
        i = entry - ExifTagTable;