[mapserver-commits] r9177 - trunk/mapserver
svn at osgeo.org
svn at osgeo.org
Tue Jul 14 00:54:00 EDT 2009
Author: warmerdam
Date: 2009-07-14 00:53:59 -0400 (Tue, 14 Jul 2009)
New Revision: 9177
Modified:
trunk/mapserver/mapoutput.c
Log:
Removed some redundant code in msSelectOutputFormat() as suggested by Steve.
Modified: trunk/mapserver/mapoutput.c
===================================================================
--- trunk/mapserver/mapoutput.c 2009-07-14 04:36:33 UTC (rev 9176)
+++ trunk/mapserver/mapoutput.c 2009-07-14 04:53:59 UTC (rev 9177)
@@ -598,34 +598,20 @@
const char *imagetype )
{
- int i, index;
+ int index;
outputFormatObj *format = NULL;
if( map == NULL || imagetype == NULL || strlen(imagetype) == 0 )
return NULL;
- index = msGetOutputFormatIndex(map, imagetype);
- if (index >= 0)
- format = map->outputformatlist[index];
-
/* -------------------------------------------------------------------- */
/* Try to find the format in the maps list of formats, first by */
/* mime type, and then by output format name. */
/* -------------------------------------------------------------------- */
- for( i = 0; i < map->numoutputformats && format == NULL; i++ )
- {
- if( map->outputformatlist[i]->mimetype != NULL
- && strcasecmp(imagetype,
- map->outputformatlist[i]->mimetype) == 0 )
- format = map->outputformatlist[i];
- }
-
- for( i = 0; i < map->numoutputformats && format == NULL; i++ )
- {
- if( strcasecmp(imagetype,map->outputformatlist[i]->name) == 0 )
- format = map->outputformatlist[i];
- }
-
+ index = msGetOutputFormatIndex(map, imagetype);
+ if (index >= 0)
+ format = map->outputformatlist[index];
+
if (format)
{
if (map->imagetype)
More information about the mapserver-commits
mailing list