Форматирование

This commit is contained in:
Andrei Astafev 2023-07-30 11:40:55 +03:00
parent 1d5707399f
commit 2964f29139

View File

@ -38,8 +38,7 @@ int slowFunction()
constexpr int size = 16 * 1024; constexpr int size = 16 * 1024;
double a[size]; double a[size];
for ( int i = 0; i < size; i++ ) for ( int i = 0; i < size; i++ ) {
{
a[i] = QRandomGenerator::global()->bounded( 4 ); a[i] = QRandomGenerator::global()->bounded( 4 );
for ( int j = 0; j < i; j++ ) a[i] += sin( a[j] ); for ( int j = 0; j < i; j++ ) a[i] += sin( a[j] );
a[0] += a[i]; a[0] += a[i];
@ -56,8 +55,7 @@ int fastFunction()
constexpr int size = 8 * 1024; constexpr int size = 8 * 1024;
double a[size]; double a[size];
for ( int i = 0; i < size; i++ ) for ( int i = 0; i < size; i++ ) {
{
a[i] = QRandomGenerator::global()->bounded( 4 ); a[i] = QRandomGenerator::global()->bounded( 4 );
for ( int j = 0; j < i; j++ ) a[i] += sin( a[j] ); for ( int j = 0; j < i; j++ ) a[i] += sin( a[j] );
a[0] += a[i]; a[0] += a[i];
@ -80,21 +78,18 @@ int main( int argc, char** argv )
QList< int > il; QList< int > il;
il << 111 << 222; il << 111 << 222;
Q_FOREACH ( int i, il ) Q_FOREACH ( int i, il ) {
{
qDebug() << i; qDebug() << i;
} }
QStringList sl; QStringList sl;
sl << QStringLiteral("111") << QStringLiteral("222"); sl << QStringLiteral( "111" ) << QStringLiteral( "222" );
for ( const auto &s: qAsConst(sl) ) for ( const auto& s: qAsConst( sl ) ) {
{
qDebug() << s; qDebug() << s;
} }
for ( auto s: qAsConst( sl ) ) for ( auto s: qAsConst( sl ) ) {
{
s.append( "0" ); s.append( "0" );
} }
@ -104,7 +99,7 @@ int main( int argc, char** argv )
QFile* f = new QFile(); QFile* f = new QFile();
Processor p; Processor p;
QObject::connect( &app, &QCoreApplication::aboutToQuit, &p, &Processor::process); QObject::connect( &app, &QCoreApplication::aboutToQuit, &p, &Processor::process );
QTimer::singleShot( 100, &app, SLOT(quit())); QTimer::singleShot( 100, &app, SLOT(quit()));
#ifdef PROFILE #ifdef PROFILE