Changeset 445e55 in git


Ignore:
Timestamp:
Apr 18, 2007, 6:15:59 PM (17 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b4f17ed1d25f93d46dbe29e4b499baecc2fd51bb')
Children:
1d430ab97fb0bc40dcbac66c9e99a0f9c3344fec
Parents:
7ba9fe121c436f581536f3d3a05ab906f5cbe6cc
Message:
*hannes: faster getid


git-svn-id: file:///usr/local/Singular/svn/trunk@9977 2c84dea3-7e68-4137-9b89-c4e89433aadc
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • Singular/ipid.cc

    r7ba9fe r445e55  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ipid.cc,v 1.79 2007-03-13 16:03:24 Singular Exp $ */
     4/* $Id: ipid.cc,v 1.80 2007-04-18 16:15:58 Singular Exp $ */
    55
    66/*
     
    5858/*0 implementation*/
    5959
     60#ifdef HAVE_IDI
     61int iiS2I(const char *s, int &less4)
     62{
     63  less4=1;
     64  int i;
     65  i=s[0];
     66  if (s[1]!='\0')
     67  {
     68    i=(i<<8)+s[1];
     69    if (s[2]!='\0')
     70    {
     71      i=(i<<8)+s[2];
     72      if (s[3]!='\0')
     73      {
     74        i=(i<<8)+s[3];
     75        less4=0;
     76      }
     77    }
     78  }
     79  return i; 
     80}
     81#endif
    6082idhdl idrec::get(const char * s, int lev)
    6183{
     
    6688  int l;
    6789  char *id;
     90#ifndef HAVE_IDI
    6891  if (s[1]=='\0')
    6992  {
     
    203226      if (*(short *)s==*(short *)id)
    204227      {
    205         if (0 == strcmp(s+2,id+2))
     228        if (0 == strcmp(s+1,id+1))
    206229        {
    207230          if (l==lev) return h;
     
    216239  }
    217240  return found;
     241#else
     242  int less4;
     243  int i=iiS2I(s,less4);
     244  while (h!=NULL)
     245  {
     246    omCheckAddr(IDID(h));
     247    l=IDLEV(h);
     248    if ((l==0)||(l==lev))
     249    {
     250      if (i==h->id_i)
     251      {
     252        id=IDID(h);
     253        if (less4 || (0 == strcmp(s+4,id+4)))
     254        {
     255          if (l==lev) return h;
     256          found=h;
     257        }
     258      }
     259    }
     260    h = IDNEXT(h);
     261  }
     262  return found;
     263#endif
    218264}
    219265
     
    237283  IDLEV(h)  = lev;
    238284  IDNEXT(h) = this;
     285#ifdef HAVE_IDI
     286  int dummy;
     287  h->id_i=iiS2I(s,dummy);
     288#endif
    239289  if (init)
    240290  {
  • Singular/mpsr_Get.h

    r7ba9fe r445e55  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: mpsr_Get.h,v 1.14 2003-12-10 17:35:18 Singular Exp $ */
     4/* $Id: mpsr_Get.h,v 1.15 2007-04-18 16:15:59 Singular Exp $ */
    55/***************************************************************
    66 *
     
    111111  IDTYP(h) = tok;
    112112  IDDATA(h) = (char *) data;
    113 
     113#ifdef HAVE_IDI
     114  extern int iiS2I(const char *s, int &less4);
     115  int dummy;
     116  h->id_i=iiS2I(name,dummy);
     117#endif
    114118  return h;
    115119}
  • kernel/structs.h

    r7ba9fe r445e55  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: structs.h,v 1.33 2007-03-01 09:15:51 Singular Exp $ */
     6/* $Id: structs.h,v 1.34 2007-04-18 16:15:58 Singular Exp $ */
    77/*
    88* ABSTRACT
     
    3131   but configure dislikes it */
    3232
     33#define HAVE_IDI 1
    3334
    3435#if defined(i386) || defined(x86_64_Linux) || defined(ix86_SunOS)
     
    859860  short      lev;
    860861  short      ref;
     862#ifdef HAVE_IDI
     863  int        id_i;
     864#endif
    861865
    862866#define IDNEXT(a)    ((a)->next)
Note: See TracChangeset for help on using the changeset viewer.