Merge pull request #14 from sdteffen/usePUMPINDEX

Simpler, faster code using PUMPINDEX()
This commit is contained in:
Sam Hatchett
2014-01-27 07:31:49 -08:00

View File

@@ -2515,18 +2515,11 @@ int DLLEXPORT ENgetheadcurve(int index, char *id)
**----------------------------------------------------------------
*/
{
int i;
strcpy(id,"");
if (!Openflag) return(102);
for (i=1; i<=Npumps; i++)
{
if(Pump[i].Link = index)
{
strcpy(id,Curve[Pump[i].Hcurve].ID);
return(0);
}
}
return(204);
if (index < 1 || index > Nlinks || PUMP != Link[index].Type) return(204);
strcpy(id,Curve[Pump[PUMPINDEX(index)].Hcurve].ID);
return(0);
}
int DLLEXPORT ENgetpumptype(int index, int *type)
@@ -2539,18 +2532,11 @@ int DLLEXPORT ENgetpumptype(int index, int *type)
**----------------------------------------------------------------
*/
{
int i;
*type=-1;
if (!Openflag) return(102);
for (i=1; i<=Npumps; i++)
{
if(Pump[i].Link = index)
{
*type = Pump[i].Ptype;
return(0);
}
}
return(204);
if (index < 1 || index > Nlinks || PUMP != Link[index].Type) return(204);
*type = Pump[PUMPINDEX(index)].Ptype;
return(0);
}
/*