IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 26, 2006, 1:48:43 PM (20 years ago)
Author:
jhoblitt
Message:

factor out 'where' query from parameter generation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/src/p2searchDoneFrames.c

    r6210 r6214  
    55    PS_ASSERT_PTR_NON_NULL(config, NULL);
    66
    7     psMetadata *where = psMetadataAlloc ();
    8 
    9     if (config->camera_name != NULL) {
    10         psMetadataAddStr(where, PS_LIST_TAIL, "camera", 0, "==",
    11             config->camera_name);
    12     }
    13     if (config->filter != NULL) {
    14         psMetadataAddStr(where, PS_LIST_TAIL, "filter", 0, "==",
    15             config->filter);
    16     }
    17 
    18     if (where->list->n < 1) {
    19        psFree(where);
    20        where = NULL;
    21     }
    22 
    23     psArray *exposures = p2DoneExpSelectRowObjects(config->database, where,
    24         MAX_ROWS);
    25     psFree (where);
     7    psArray *exposures = p2DoneExpSelectRowObjects(config->database,
     8        config->where, MAX_ROWS);
    269    if (!exposures) {
    2710        psError(PS_ERR_UNKNOWN, false, "no p2DoneExp rows found");
     
    3417    frames->n = 0;
    3518
    36     // 'where' to select each exposure
    37     where = psMetadataAlloc ();
    3819    for (int i = 0; i < exposures->n; i++) {
    3920        p2DoneExpRow *exposure = exposures->data[i];
    4021
     22        // 'where' to select each exposure
     23        psMetadata *where = psMetadataAlloc ();
    4124        psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", PS_META_REPLACE, "==",
    4225            exposure->exp_id);
     
    4427        psArray *images = p2DoneImfileSelectRowObjects(config->database, where,
    4528            MAX_ROWS);
     29        psFree(where);
    4630        if (!images) {
    4731            psError(PS_ERR_UNKNOWN, false, "database access failed");
Note: See TracChangeset for help on using the changeset viewer.