[Python-checkins] CVS: python/dist/src/Objects longobject.c,1.85,1.86

Tim Peters tim_one@users.sourceforge.net
2001年7月14日 04:01:30 -0700


Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv22122/python/dist/src/Objects
Modified Files:
	longobject.c 
Log Message:
long_format(): Simplify new code a bit.
Index: longobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/longobject.c,v
retrieving revision 1.85
retrieving revision 1.86
diff -C2 -r1.85 -r1.86
*** longobject.c	2001年07月13日 02:59:26	1.85
--- longobject.c	2001年07月14日 11:01:28	1.86
***************
*** 841,845 ****
 				return NULL;
 			})
! 			while (--ntostore >= 0) {
 				digit nextrem = (digit)(rem / base);
 				char c = (char)(rem - nextrem * base);
--- 841,846 ----
 				return NULL;
 			})
! 			assert(ntostore > 0);
! 			do {
 				digit nextrem = (digit)(rem / base);
 				char c = (char)(rem - nextrem * base);
***************
*** 848,855 ****
 				*--p = c;
 				rem = nextrem;
! 				if (a->ob_size == 0 && rem == 0)
! 					break; /* skip leading zeroes */
! 			}
! 		} while (ABS(a->ob_size) != 0);
 		Py_DECREF(a);
 	}
--- 849,858 ----
 				*--p = c;
 				rem = nextrem;
! 				--ntostore;
! 				/* Termination is a bit delicate: must not
! 				 store leading zeroes, so must get out if
! 				 a and rem are both 0 now. */
! 			} while (ntostore && (a->ob_size || rem));
! 		} while (a->ob_size != 0);
 		Py_DECREF(a);
 	}

AltStyle によって変換されたページ (->オリジナル) /