remove a couple of statics

g_once() is fast enough
This commit is contained in:
John Cupitt 2016-10-11 14:12:45 +01:00
parent 524c395f01
commit bc0bde85cb
1 changed files with 4 additions and 20 deletions

View File

@ -169,17 +169,9 @@ calcul_tables_8( void *client )
static void
vips_col_make_tables_RGB_8( void )
{
static gboolean made_tables = FALSE;
static GOnce once = G_ONCE_INIT;
/* We want to avoid having a mutex in this path, so use gonce and a
* static var instead.
*/
if( !made_tables ) {
static GOnce once = G_ONCE_INIT;
(void) g_once( &once, calcul_tables_8, NULL );
made_tables = TRUE;
}
(void) g_once( &once, calcul_tables_8, NULL );
}
int
@ -201,17 +193,9 @@ calcul_tables_16( void *client )
static void
vips_col_make_tables_RGB_16( void )
{
static gboolean made_tables = FALSE;
static GOnce once = G_ONCE_INIT;
/* We want to avoid having a mutex in this path, so use gonce and a
* static var instead.
*/
if( !made_tables ) {
static GOnce once = G_ONCE_INIT;
(void) g_once( &once, calcul_tables_16, NULL );
made_tables = TRUE;
}
(void) g_once( &once, calcul_tables_16, NULL );
}
int