Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
51376284
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
接近 2 年 前同步成功
通知
1
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看板
提交
51376284
编写于
5月 13, 2019
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[iter] Track strictly-sorted iterators
This make output of hb_enumerate() sorted regardless of input iterator.
上级
7e02063f
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
24 addition
and
12 deletion
+24
-12
src/hb-array.hh
src/hb-array.hh
+1
-1
src/hb-iter.hh
src/hb-iter.hh
+21
-9
src/hb-ot-layout-common.hh
src/hb-ot-layout-common.hh
+1
-1
src/hb-set.hh
src/hb-set.hh
+1
-1
未找到文件。
src/hb-array.hh
浏览文件 @
51376284
...
@@ -226,7 +226,7 @@ struct hb_sorted_array_t :
...
@@ -226,7 +226,7 @@ struct hb_sorted_array_t :
typedef
hb_iter_t
<
hb_sorted_array_t
<
Type
>
,
Type
&>
iter_base_t
;
typedef
hb_iter_t
<
hb_sorted_array_t
<
Type
>
,
Type
&>
iter_base_t
;
HB_ITER_USING
(
iter_base_t
);
HB_ITER_USING
(
iter_base_t
);
static
constexpr
bool
is_random_access_iterator
=
true
;
static
constexpr
bool
is_random_access_iterator
=
true
;
static
constexpr
bool
is_sorted_iterator
=
true
;
static
constexpr
hb_sortedness_t
is_sorted_iterator
=
hb_sortedness_t
::
SORTED
;
hb_sorted_array_t
()
:
hb_array_t
<
Type
>
()
{}
hb_sorted_array_t
()
:
hb_array_t
<
Type
>
()
{}
hb_sorted_array_t
(
Type
*
array_
,
unsigned
int
length_
)
:
hb_array_t
<
Type
>
(
array_
,
length_
)
{}
hb_sorted_array_t
(
Type
*
array_
,
unsigned
int
length_
)
:
hb_array_t
<
Type
>
(
array_
,
length_
)
{}
...
...
src/hb-iter.hh
浏览文件 @
51376284
...
@@ -55,6 +55,12 @@
...
@@ -55,6 +55,12 @@
* type of .end()?
* type of .end()?
*/
*/
enum
hb_sortedness_t
{
NOT_SORTED
=
0
,
SORTED
,
STRICTLY_SORTED
,
};
/*
/*
* Base classes for iterators.
* Base classes for iterators.
...
@@ -68,7 +74,7 @@ struct hb_iter_t
...
@@ -68,7 +74,7 @@ struct hb_iter_t
static
constexpr
unsigned
item_size
=
hb_static_size
(
Item
);
static
constexpr
unsigned
item_size
=
hb_static_size
(
Item
);
static
constexpr
bool
is_iterator
=
true
;
static
constexpr
bool
is_iterator
=
true
;
static
constexpr
bool
is_random_access_iterator
=
false
;
static
constexpr
bool
is_random_access_iterator
=
false
;
static
constexpr
bool
is_sorted_iterator
=
false
;
static
constexpr
hb_sortedness_t
is_sorted_iterator
=
hb_sortedness_t
::
NOT_SORTED
;
private:
private:
/* https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern */
/* https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern */
...
@@ -361,9 +367,9 @@ struct hb_map_iter_t :
...
@@ -361,9 +367,9 @@ struct hb_map_iter_t :
typedef
decltype
(
hb_get
(
hb_declval
(
Proj
),
*
hb_declval
(
Iter
)))
__item_t__
;
typedef
decltype
(
hb_get
(
hb_declval
(
Proj
),
*
hb_declval
(
Iter
)))
__item_t__
;
static
constexpr
bool
is_random_access_iterator
=
Iter
::
is_random_access_iterator
;
static
constexpr
bool
is_random_access_iterator
=
Iter
::
is_random_access_iterator
;
static
constexpr
bool
is_sorted_iterator
=
static
constexpr
hb_sortedness_t
is_sorted_iterator
=
Sorted
==
hb_function_sortedness_t
::
SORTED
?
true
Sorted
==
hb_function_sortedness_t
::
SORTED
?
hb_sortedness_t
::
SORTED
:
Sorted
==
hb_function_sortedness_t
::
RETAINS_SORTING
?
Iter
::
is_sorted_iterator
:
false
;
:
Sorted
==
hb_function_sortedness_t
::
RETAINS_SORTING
?
Iter
::
is_sorted_iterator
:
hb_sortedness_t
::
NOT_SORTED
;
__item_t__
__item__
()
const
{
return
hb_get
(
f
.
get
(),
*
it
);
}
__item_t__
__item__
()
const
{
return
hb_get
(
f
.
get
(),
*
it
);
}
__item_t__
__item_at__
(
unsigned
i
)
const
{
return
hb_get
(
f
.
get
(),
it
[
i
]);
}
__item_t__
__item_at__
(
unsigned
i
)
const
{
return
hb_get
(
f
.
get
(),
it
[
i
]);
}
bool
__more__
()
const
{
return
bool
(
it
);
}
bool
__more__
()
const
{
return
bool
(
it
);
}
...
@@ -430,7 +436,7 @@ struct hb_filter_iter_t :
...
@@ -430,7 +436,7 @@ struct hb_filter_iter_t :
{
while
(
it
&&
!
hb_has
(
p
.
get
(),
hb_get
(
f
.
get
(),
*
it
)))
++
it
;
}
{
while
(
it
&&
!
hb_has
(
p
.
get
(),
hb_get
(
f
.
get
(),
*
it
)))
++
it
;
}
typedef
typename
Iter
::
item_t
__item_t__
;
typedef
typename
Iter
::
item_t
__item_t__
;
static
constexpr
bool
is_sorted_iterator
=
Iter
::
is_sorted_iterator
;
static
constexpr
hb_sortedness_t
is_sorted_iterator
=
Iter
::
is_sorted_iterator
;
__item_t__
__item__
()
const
{
return
*
it
;
}
__item_t__
__item__
()
const
{
return
*
it
;
}
bool
__more__
()
const
{
return
bool
(
it
);
}
bool
__more__
()
const
{
return
bool
(
it
);
}
void
__next__
()
{
do
++
it
;
while
(
it
&&
!
hb_has
(
p
.
get
(),
hb_get
(
f
.
get
(),
*
it
)));
}
void
__next__
()
{
do
++
it
;
while
(
it
&&
!
hb_has
(
p
.
get
(),
hb_get
(
f
.
get
(),
*
it
)));
}
...
@@ -514,9 +520,15 @@ struct hb_zip_iter_t :
...
@@ -514,9 +520,15 @@ struct hb_zip_iter_t :
static
constexpr
bool
is_random_access_iterator
=
static
constexpr
bool
is_random_access_iterator
=
A
::
is_random_access_iterator
&&
A
::
is_random_access_iterator
&&
B
::
is_random_access_iterator
;
B
::
is_random_access_iterator
;
static
constexpr
bool
is_sorted_iterator
=
static
constexpr
hb_sortedness_t
is_sorted_iterator
=
A
::
is_sorted_iterator
&&
(
A
::
is_sorted_iterator
==
hb_sortedness_t
::
NOT_SORTED
||
B
::
is_sorted_iterator
;
B
::
is_sorted_iterator
==
hb_sortedness_t
::
NOT_SORTED
)
?
hb_sortedness_t
::
NOT_SORTED
:
(
A
::
is_sorted_iterator
==
hb_sortedness_t
::
STRICTLY_SORTED
||
B
::
is_sorted_iterator
==
hb_sortedness_t
::
STRICTLY_SORTED
)
?
hb_sortedness_t
::
STRICTLY_SORTED
:
hb_sortedness_t
::
SORTED
;
__item_t__
__item__
()
const
{
return
__item_t__
(
*
a
,
*
b
);
}
__item_t__
__item__
()
const
{
return
__item_t__
(
*
a
,
*
b
);
}
__item_t__
__item_at__
(
unsigned
i
)
const
{
return
__item_t__
(
a
[
i
],
b
[
i
]);
}
__item_t__
__item_at__
(
unsigned
i
)
const
{
return
__item_t__
(
a
[
i
],
b
[
i
]);
}
bool
__more__
()
const
{
return
bool
(
a
)
&&
bool
(
b
);
}
bool
__more__
()
const
{
return
bool
(
a
)
&&
bool
(
b
);
}
...
@@ -583,7 +595,7 @@ struct hb_counter_iter_t :
...
@@ -583,7 +595,7 @@ struct hb_counter_iter_t :
typedef
T
__item_t__
;
typedef
T
__item_t__
;
static
constexpr
bool
is_random_access_iterator
=
true
;
static
constexpr
bool
is_random_access_iterator
=
true
;
static
constexpr
bool
is_sorted_iterator
=
true
;
static
constexpr
hb_sortedness_t
is_sorted_iterator
=
hb_sortedness_t
::
STRICTLY_SORTED
;
__item_t__
__item__
()
const
{
return
+
v
;
}
__item_t__
__item__
()
const
{
return
+
v
;
}
__item_t__
__item_at__
(
unsigned
j
)
const
{
return
v
+
j
*
step
;
}
__item_t__
__item_at__
(
unsigned
j
)
const
{
return
v
+
j
*
step
;
}
bool
__more__
()
const
{
return
v
!=
end_
;
}
bool
__more__
()
const
{
return
v
!=
end_
;
}
...
...
src/hb-ot-layout-common.hh
浏览文件 @
51376284
...
@@ -1115,7 +1115,7 @@ struct Coverage
...
@@ -1115,7 +1115,7 @@ struct Coverage
struct
iter_t
:
hb_iter_with_fallback_t
<
iter_t
,
hb_codepoint_t
>
struct
iter_t
:
hb_iter_with_fallback_t
<
iter_t
,
hb_codepoint_t
>
{
{
static
constexpr
bool
is_sorted_iterator
=
true
;
static
constexpr
hb_sortedness_t
is_sorted_iterator
=
hb_sortedness_t
::
STRICTLY_SORTED
;
iter_t
(
const
Coverage
&
c_
=
Null
(
Coverage
))
iter_t
(
const
Coverage
&
c_
=
Null
(
Coverage
))
{
{
memset
(
this
,
0
,
sizeof
(
*
this
));
memset
(
this
,
0
,
sizeof
(
*
this
));
...
...
src/hb-set.hh
浏览文件 @
51376284
...
@@ -691,7 +691,7 @@ struct hb_set_t
...
@@ -691,7 +691,7 @@ struct hb_set_t
*/
*/
struct
iter_t
:
hb_iter_with_fallback_t
<
iter_t
,
hb_codepoint_t
>
struct
iter_t
:
hb_iter_with_fallback_t
<
iter_t
,
hb_codepoint_t
>
{
{
static
constexpr
bool
is_sorted_iterator
=
true
;
static
constexpr
hb_sortedness_t
is_sorted_iterator
=
hb_sortedness_t
::
STRICTLY_SORTED
;
iter_t
(
const
hb_set_t
&
s_
=
Null
(
hb_set_t
))
:
iter_t
(
const
hb_set_t
&
s_
=
Null
(
hb_set_t
))
:
s
(
&
s_
),
v
(
INVALID
),
l
(
s
->
get_population
()
+
1
)
{
__next__
();
}
s
(
&
s_
),
v
(
INVALID
),
l
(
s
->
get_population
()
+
1
)
{
__next__
();
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录