Changeset 6664a66 in git


Ignore:
Timestamp:
Jan 23, 2017, 6:00:20 PM (7 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
9ccaaf932b4894e5b87bdbc89ad0e50527144dac
Parents:
7aa46ca800cba3fb13682d6ce35874fd1e955754
Message:
minor opt: mpz_init_.../mpz_set_si -> mpz_set_ui: longrat.cc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpolys/coeffs/longrat.cc

    r7aa46c r6664a66  
    210210#endif
    211211  mpz_init_set(z->z,(mpz_ptr) from);
    212   //mpz_init_set_ui(&z->n,1);
    213212  z->s = 3;
    214213  z=nlShort3(z);
     
    674673    if (((long)a)>0L)
    675674    {
    676       mpz_init_set_si(n->z,1L);
     675      mpz_init_set_ui(n->z,1L);
    677676      mpz_init_set_si(n->n,(long)SR_TO_INT(a));
    678677    }
     
    719718              else
    720719              {
    721                 mpz_init_set_si(n->z,1L);
     720                mpz_init_set_ui(n->z,1L);
    722721              }
    723722              break;
     
    14181417  {
    14191418    mpz_t bt;
    1420     mpz_init_set(bt,b->n);
    1421     mpz_divexact(bt,bt,gcd);
     1419    mpz_init(bt);
     1420    mpz_divexact(bt,b->n,gcd);
    14221421    if (SR_HDL(a) & SR_INT)
    14231422      mpz_mul_si(result->z,bt,SR_TO_INT(a));
     
    15821581      return FALSE;
    15831582    mpz_t  bb;
    1584     mpz_init_set(bb,b->n);
    1585     mpz_mul_si(bb,bb,(long)SR_TO_INT(a));
     1583    mpz_init(bb);
     1584    mpz_mul_si(bb,b->n,(long)SR_TO_INT(a));
    15861585    bo=(mpz_cmp(bb,b->z)==0);
    15871586    mpz_clear(bb);
     
    27602759    if (SR_TO_INT(b)<0)
    27612760    {
    2762       mpz_mul_si(qq, qq, -1);
     2761      mpz_neg(qq, qq);
    27632762    }
    27642763    return nlInitMPZ(qq,R);
Note: See TracChangeset for help on using the changeset viewer.