/[pspp]/pspp/src/dictionary.c
ViewVC logotype

Diff of /pspp/src/dictionary.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.26 by blp, Sun Aug 7 04:39:28 2005 UTC revision 1.27 by blp, Sun Aug 21 07:21:06 2005 UTC
# Line 491  dict_delete_vars (struct dictionary *d, Line 491  dict_delete_vars (struct dictionary *d,
491      dict_delete_var (d, *vars++);      dict_delete_var (d, *vars++);
492  }  }
493    
494    /* Deletes scratch variables from dictionary D. */
495    void
496    dict_delete_scratch_vars (struct dictionary *d)
497    {
498      int i;
499    
500      /* FIXME: this can be done in O(count) time, but this algorithm
501         is O(count**2). */
502      assert (d != NULL);
503    
504      for (i = 0; i < d->var_cnt; )
505        if (dict_class_from_id (d->var[i]->name) == DC_SCRATCH)
506          dict_delete_var (d, d->var[i]);
507        else
508          i++;
509    }
510    
511  /* Moves V to 0-based position IDX in D.  Other variables in D,  /* Moves V to 0-based position IDX in D.  Other variables in D,
512     if any, retain their relative positions.  Runs in time linear     if any, retain their relative positions.  Runs in time linear
513     in the distance moved. */     in the distance moved. */

Legend:
Removed from v.1.26  
changed lines
  Added in v.1.27

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26