@@ -66,16 +66,20 @@ cmd.handler = function(argv) {
6666 if ( result . ok ) {
6767 session . updateStat ( 'ac' , 1 ) ;
6868 session . updateStat ( 'ac.set' , problem . fid ) ;
69- if ( result . runtime_percentile )
70- printLine ( result , 'Your runtime beats %d %% of %s submissions' ,
71- result . runtime_percentile . toFixed ( 2 ) , result . lang ) ;
72- else
73- return log . warn ( 'Failed to get runtime percentile.' ) ;
74- if ( result . memory && result . memory_percentile )
75- printLine ( result , 'Your memory usage beats %d %% of %s submissions (%s)' ,
76- result . memory_percentile . toFixed ( 2 ) , result . lang , result . memory ) ;
77- else
78- return log . warn ( 'Failed to get memory percentile.' ) ;
69+
70+ ( function ( ) {
71+ if ( result . runtime_percentile )
72+ printLine ( result , 'Your runtime beats %d %% of %s submissions' ,
73+ result . runtime_percentile . toFixed ( 2 ) , result . lang ) ;
74+ else
75+ return log . warn ( 'Failed to get runtime percentile.' ) ;
76+ if ( result . memory && result . memory_percentile )
77+ printLine ( result , 'Your memory usage beats %d %% of %s submissions (%s)' ,
78+ result . memory_percentile . toFixed ( 2 ) , result . lang , result . memory ) ;
79+ else
80+ return log . warn ( 'Failed to get memory percentile.' ) ;
81+ } ) ( ) ;
82+
7983 // core.getSubmission({id: result.id}, function(e, submission) {
8084 // if (e || !submission || !submission.distributionChart)
8185 // return log.warn('Failed to get submission beat ratio.');
0 commit comments