Skip to content

Commit 4964c5c

Browse files
committed
Move bc_copy_num to header to allow inlining
1 parent be072d7 commit 4964c5c

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

ext/bcmath/libbcmath/src/bcmath.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,12 @@ bc_num _bc_new_num_ex(size_t length, size_t scale, bool persistent);
8888

8989
void _bc_free_num_ex(bc_num *num, bool persistent);
9090

91-
bc_num bc_copy_num(bc_num num);
91+
/* Make a copy of a number! Just increments the reference count! */
92+
static inline bc_num bc_copy_num(bc_num num)
93+
{
94+
num->n_refs++;
95+
return num;
96+
}
9297

9398
void bc_init_num(bc_num *num);
9499

ext/bcmath/libbcmath/src/init.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,6 @@ void bc_init_numbers(void)
7777
}
7878

7979

80-
/* Make a copy of a number! Just increments the reference count! */
81-
bc_num bc_copy_num(bc_num num)
82-
{
83-
num->n_refs++;
84-
return num;
85-
}
86-
87-
8880
/* Initialize a number NUM by making it a copy of zero. */
8981
void bc_init_num(bc_num *num)
9082
{

0 commit comments

Comments
 (0)