Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
capnproto
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
capnproto
Commits
9842ff91
Commit
9842ff91
authored
Oct 23, 2017
by
Kenton Varda
Committed by
GitHub
Oct 23, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "avoid passing invalid reference to Array<T> constructor"
parent
d067d620
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
8 deletions
+2
-8
array.h
c++/src/kj/array.h
+2
-8
No files found.
c++/src/kj/array.h
View file @
9842ff91
...
@@ -450,17 +450,11 @@ public:
...
@@ -450,17 +450,11 @@ public:
// check might catch bugs. Probably people should use Vector if they want to build arrays
// check might catch bugs. Probably people should use Vector if they want to build arrays
// without knowing the final size in advance.
// without knowing the final size in advance.
KJ_IREQUIRE
(
pos
==
endPtr
,
"ArrayBuilder::finish() called prematurely."
);
KJ_IREQUIRE
(
pos
==
endPtr
,
"ArrayBuilder::finish() called prematurely."
);
const
ptrdiff_t
size
=
pos
-
ptr
;
Array
<
T
>
result
(
reinterpret_cast
<
T
*>
(
ptr
),
pos
-
ptr
,
*
disposer
);
T
*
start
=
reinterpret_cast
<
T
*>
(
ptr
);
ptr
=
nullptr
;
ptr
=
nullptr
;
pos
=
nullptr
;
pos
=
nullptr
;
endPtr
=
nullptr
;
endPtr
=
nullptr
;
if
(
size
==
0
)
{
return
result
;
// `disposer` possibly does not point to anything, so don't pass `*disposer` to `Array`.
return
Array
<
T
>
();
}
else
{
return
Array
<
T
>
(
start
,
size
,
*
disposer
);
}
}
}
inline
bool
isFull
()
const
{
inline
bool
isFull
()
const
{
...
...
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