Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
c3b57f23
Commit
c3b57f23
authored
Aug 29, 2008
by
Kenichi Handa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(optimize_sub_char_table): Perform more greedy optimization.
parent
a48a6418
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
src/chartab.c
src/chartab.c
+6
-7
No files found.
src/chartab.c
View file @
c3b57f23
...
...
@@ -660,28 +660,27 @@ optimize_sub_char_table (table, test)
struct
Lisp_Sub_Char_Table
*
tbl
=
XSUB_CHAR_TABLE
(
table
);
int
depth
=
XINT
(
tbl
->
depth
);
Lisp_Object
elt
,
this
;
int
i
;
int
i
,
optimizable
;
elt
=
XSUB_CHAR_TABLE
(
table
)
->
contents
[
0
];
if
(
SUB_CHAR_TABLE_P
(
elt
))
elt
=
XSUB_CHAR_TABLE
(
table
)
->
contents
[
0
]
=
optimize_sub_char_table
(
elt
,
test
);
if
(
SUB_CHAR_TABLE_P
(
elt
))
return
table
;
optimizable
=
SUB_CHAR_TABLE_P
(
elt
)
?
0
:
1
;
for
(
i
=
1
;
i
<
chartab_size
[
depth
];
i
++
)
{
this
=
XSUB_CHAR_TABLE
(
table
)
->
contents
[
i
];
if
(
SUB_CHAR_TABLE_P
(
this
))
this
=
XSUB_CHAR_TABLE
(
table
)
->
contents
[
i
]
=
optimize_sub_char_table
(
this
,
test
);
if
(
SUB_CHAR_TABLE_P
(
this
)
||
(
NILP
(
test
)
?
NILP
(
Fequal
(
this
,
elt
))
/* defaults to `equal'. */
if
(
optimizable
&&
(
NILP
(
test
)
?
NILP
(
Fequal
(
this
,
elt
))
/* defaults to `equal'. */
:
EQ
(
test
,
Qeq
)
?
!
EQ
(
this
,
elt
)
/* Optimize `eq' case. */
:
NILP
(
call2
(
test
,
this
,
elt
))))
break
;
optimizable
=
0
;
}
return
(
i
<
chartab_size
[
depth
]
?
table
:
elt
);
return
(
optimizable
?
elt
:
table
);
}
DEFUN
(
"optimize-char-table"
,
Foptimize_char_table
,
Soptimize_char_table
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment