comparison src/buffer.c @ 16:0293115a14e9 r19-15b91

Import from CVS: tag r19-15b91
author cvs
date Mon, 13 Aug 2007 08:49:20 +0200
parents 9ee227acff29
children 859a2309aef8
comparison
equal deleted inserted replaced
15:ad457d5f7d04 16:0293115a14e9
1583 Lisp_Object valcontents = XSYMBOL (sym)->value; 1583 Lisp_Object valcontents = XSYMBOL (sym)->value;
1584 if (SYMBOL_VALUE_MAGIC_P (valcontents)) 1584 if (SYMBOL_VALUE_MAGIC_P (valcontents))
1585 { 1585 {
1586 /* Just reference the variable 1586 /* Just reference the variable
1587 to cause it to become set for this buffer. */ 1587 to cause it to become set for this buffer. */
1588 (void) find_symbol_value (sym); 1588 /* Use find_symbol_value_quickly to avoid an unnecessary O(n)
1589 lookup. */
1590 (void) find_symbol_value_quickly (XCAR (tail), 1);
1589 } 1591 }
1590 } 1592 }
1591 1593
1592 /* Do the same with any others that were local to the previous buffer */ 1594 /* Do the same with any others that were local to the previous buffer */
1593 1595
1594 if (old_buf) 1596 if (old_buf)
1595 { 1597 {
1596 for (tail = old_buf->local_var_alist; 1598 LIST_LOOP (tail, old_buf->local_var_alist)
1597 !NILP (tail);
1598 tail = XCDR (tail))
1599 { 1599 {
1600 Lisp_Object sym = XCAR (XCAR (tail)); 1600 Lisp_Object sym = XCAR (XCAR (tail));
1601 Lisp_Object valcontents = XSYMBOL (sym)->value; 1601 Lisp_Object valcontents = XSYMBOL (sym)->value;
1602 1602
1603 if (SYMBOL_VALUE_MAGIC_P (valcontents)) 1603 if (SYMBOL_VALUE_MAGIC_P (valcontents))
1604 { 1604 {
1605 /* Just reference the variable 1605 /* Just reference the variable
1606 to cause it to become set for this buffer. */ 1606 to cause it to become set for this buffer. */
1607 (void) find_symbol_value (sym); 1607 /* Use find_symbol_value_quickly with find_it_p as 0 to avoid an
1608 unnecessary O(n) lookup which is guaranteed to be worst case.
1609 Any symbols which are local are guaranteed to have been
1610 handled in the previous loop, above. */
1611 (void) find_symbol_value_quickly (sym, 0);
1608 } 1612 }
1609 } 1613 }
1610 } 1614 }
1611 } 1615 }
1612 1616