Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
74963bce
Commit
74963bce
authored
Apr 12, 2016
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lib/icu/Collate: use class AllocatedArray
parent
33a4dbe1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
9 deletions
+5
-9
Collate.cxx
src/lib/icu/Collate.cxx
+5
-9
No files found.
src/lib/icu/Collate.cxx
View file @
74963bce
...
@@ -144,22 +144,18 @@ IcuCaseFold(const char *src)
...
@@ -144,22 +144,18 @@ IcuCaseFold(const char *src)
if
(
u
.
IsNull
())
if
(
u
.
IsNull
())
return
AllocatedString
<>::
Duplicate
(
src
);
return
AllocatedString
<>::
Duplicate
(
src
);
size_t
folded_capacity
=
u
.
size
()
*
2u
;
AllocatedArray
<
UChar
>
folded
(
u
.
size
()
*
2u
);
UChar
*
folded
=
new
UChar
[
folded_capacity
];
UErrorCode
error_code
=
U_ZERO_ERROR
;
UErrorCode
error_code
=
U_ZERO_ERROR
;
size_t
folded_length
=
u_strFoldCase
(
folded
,
folded_capacity
,
size_t
folded_length
=
u_strFoldCase
(
folded
.
begin
(),
folded
.
size
()
,
u
.
begin
(),
u
.
size
(),
u
.
begin
(),
u
.
size
(),
U_FOLD_CASE_DEFAULT
,
U_FOLD_CASE_DEFAULT
,
&
error_code
);
&
error_code
);
if
(
folded_length
==
0
||
error_code
!=
U_ZERO_ERROR
)
{
if
(
folded_length
==
0
||
error_code
!=
U_ZERO_ERROR
)
delete
[]
folded
;
return
AllocatedString
<>::
Duplicate
(
src
);
return
AllocatedString
<>::
Duplicate
(
src
);
}
auto
result
=
UCharToUTF8
({
folded
,
folded_length
});
folded
.
SetSize
(
folded_length
);
delete
[]
folded
;
return
UCharToUTF8
({
folded
.
begin
(),
folded
.
size
()});
return
result
;
#elif defined(WIN32)
#elif defined(WIN32)
const
auto
u
=
MultiByteToWideChar
(
CP_UTF8
,
src
);
const
auto
u
=
MultiByteToWideChar
(
CP_UTF8
,
src
);
...
...
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