Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
3098b6cf
Commit
3098b6cf
authored
Oct 18, 2013
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qsort2, pop, push methods for Dynamic_array<>
parent
b221ec65
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
sql/sql_array.h
sql/sql_array.h
+16
-0
No files found.
sql/sql_array.h
View file @
3098b6cf
...
...
@@ -130,6 +130,16 @@ template <class Elem> class Dynamic_array
return
(
insert_dynamic
(
&
array
,
(
uchar
*
)
&
el
));
}
bool
push
(
Elem
&
el
)
{
return
append
(
el
);
}
Elem
*
pop
()
{
return
(
Elem
*
)
pop_dynamic
(
&
array
);
}
size_t
elements
()
{
return
array
.
elements
;
...
...
@@ -168,6 +178,12 @@ template <class Elem> class Dynamic_array
{
my_qsort
(
array
.
buffer
,
array
.
elements
,
sizeof
(
Elem
),
(
qsort_cmp
)
cmp_func
);
}
typedef
int
(
*
CMP_FUNC2
)(
const
Elem
*
el1
,
const
Elem
*
el2
,
void
*
);
void
sort
(
CMP_FUNC2
cmp_func
,
void
*
data
)
{
my_qsort2
(
array
.
buffer
,
array
.
elements
,
sizeof
(
Elem
),
(
qsort2_cmp
)
cmp_func
,
data
);
}
};
/*
...
...
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