Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
c4aa10eb
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
大约 1 年 前同步成功
通知
0
Star
18
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Harfbuzz
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c4aa10eb
编写于
7月 02, 2019
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use constexpr to replace passthru_ bools
上级
2e48fd07
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
10 addition
and
16 deletion
+10
-16
src/hb-algs.hh
src/hb-algs.hh
+0
-8
src/hb-set.hh
src/hb-set.hh
+10
-8
未找到文件。
src/hb-algs.hh
浏览文件 @
c4aa10eb
...
...
@@ -915,32 +915,24 @@ hb_codepoint_parse (const char *s, unsigned int len, int base, hb_codepoint_t *o
struct
hb_bitwise_and
{
HB_PARTIALIZE
(
2
);
static
constexpr
bool
passthru_left
=
false
;
static
constexpr
bool
passthru_right
=
false
;
template
<
typename
T
>
constexpr
auto
operator
()
(
const
T
&
a
,
const
T
&
b
)
const
HB_AUTO_RETURN
(
a
&
b
)
}
HB_FUNCOBJ
(
hb_bitwise_and
);
struct
hb_bitwise_or
{
HB_PARTIALIZE
(
2
);
static
constexpr
bool
passthru_left
=
true
;
static
constexpr
bool
passthru_right
=
true
;
template
<
typename
T
>
constexpr
auto
operator
()
(
const
T
&
a
,
const
T
&
b
)
const
HB_AUTO_RETURN
(
a
|
b
)
}
HB_FUNCOBJ
(
hb_bitwise_or
);
struct
hb_bitwise_xor
{
HB_PARTIALIZE
(
2
);
static
constexpr
bool
passthru_left
=
true
;
static
constexpr
bool
passthru_right
=
true
;
template
<
typename
T
>
constexpr
auto
operator
()
(
const
T
&
a
,
const
T
&
b
)
const
HB_AUTO_RETURN
(
a
^
b
)
}
HB_FUNCOBJ
(
hb_bitwise_xor
);
struct
hb_bitwise_sub
{
HB_PARTIALIZE
(
2
);
static
constexpr
bool
passthru_left
=
true
;
static
constexpr
bool
passthru_right
=
false
;
template
<
typename
T
>
constexpr
auto
operator
()
(
const
T
&
a
,
const
T
&
b
)
const
HB_AUTO_RETURN
(
a
&
~
b
)
}
...
...
src/hb-set.hh
浏览文件 @
c4aa10eb
...
...
@@ -448,6 +448,8 @@ struct hb_set_t
dirty
();
constexpr
bool
passthru_left
=
op
(
0
,
0
)
||
op
(
1
,
0
);
constexpr
bool
passthru_right
=
op
(
0
,
0
)
||
op
(
0
,
1
);
unsigned
int
na
=
pages
.
length
;
unsigned
int
nb
=
other
->
pages
.
length
;
unsigned
int
next_page
=
na
;
...
...
@@ -464,20 +466,20 @@ struct hb_set_t
}
else
if
(
page_map
[
a
].
major
<
other
->
page_map
[
b
].
major
)
{
if
(
Op
::
passthru_left
)
if
(
passthru_left
)
count
++
;
a
++
;
}
else
{
if
(
Op
::
passthru_right
)
if
(
passthru_right
)
count
++
;
b
++
;
}
}
if
(
Op
::
passthru_left
)
if
(
passthru_left
)
count
+=
na
-
a
;
if
(
Op
::
passthru_right
)
if
(
passthru_right
)
count
+=
nb
-
b
;
if
(
count
>
pages
.
length
)
...
...
@@ -501,7 +503,7 @@ struct hb_set_t
else
if
(
page_map
[
a
-
1
].
major
>
other
->
page_map
[
b
-
1
].
major
)
{
a
--
;
if
(
Op
::
passthru_left
)
if
(
passthru_left
)
{
count
--
;
page_map
[
count
]
=
page_map
[
a
];
...
...
@@ -510,7 +512,7 @@ struct hb_set_t
else
{
b
--
;
if
(
Op
::
passthru_right
)
if
(
passthru_right
)
{
count
--
;
page_map
[
count
].
major
=
other
->
page_map
[
b
].
major
;
...
...
@@ -519,14 +521,14 @@ struct hb_set_t
}
}
}
if
(
Op
::
passthru_left
)
if
(
passthru_left
)
while
(
a
)
{
a
--
;
count
--
;
page_map
[
count
]
=
page_map
[
a
];
}
if
(
Op
::
passthru_right
)
if
(
passthru_right
)
while
(
b
)
{
b
--
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录