Ignore:
Timestamp:
Oct 9, 2008, 6:12:33 AM (17 years ago)
Author:
bird
Message:

kmk: Some minor optimizations.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/function.c

    r1793 r1805  
    931931  char *list = expand_argument (argv[1], NULL);
    932932  const char *body = argv[2];
     933#ifdef KMK
     934  long body_len = strlen (body);
     935#endif /* KMK - optimization */
    933936
    934937  int doneany = 0;
     
    944947  while ((p = find_next_token (&list_iterator, &len)) != 0)
    945948    {
     949#ifndef KMK
    946950      char *result = 0;
     951#endif /* KMK - optimization */
    947952#ifdef CONFIG_WITH_VALUE_LENGTH
    948953      if (len >= (unsigned int)var->value_alloc_len)
     
    960965#endif
    961966
     967#ifndef KMK
    962968      result = allocated_variable_expand (body);
    963969
     
    966972      doneany = 1;
    967973      free (result);
     974#else  /* KMK - optimization */
     975      variable_expand_string_2 (o, body, body_len, &o);
     976      o = variable_buffer_output (o, " ", 1);
     977      doneany = 1;
     978#endif /* KMK - optimization */
    968979    }
    969980
     
    43034314
    43044315      v->exp_count = EXP_COUNT_MAX;
     4316#ifndef KMK
    43054317      o = variable_expand_string (o, body, flen+3);
    43064318      v->exp_count = 0;
    43074319
    43084320      o += strlen (o);
     4321#else  /* KMK - optimization */
     4322      variable_expand_string_2 (o, body, flen+3, &o);
     4323      v->exp_count = 0;
     4324#endif /* KMK - optimization */
    43094325#ifdef CONFIG_WITH_EVALPLUS
    43104326    }
Note: See TracChangeset for help on using the changeset viewer.