From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 953B8805F for ; Tue, 16 Dec 2014 20:35:53 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 16 Dec 2014 10:39:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,588,1413270000"; d="scan'208";a="638536113" Received: from irsmsx152.ger.corp.intel.com ([163.33.192.66]) by fmsmga001.fm.intel.com with ESMTP; 16 Dec 2014 10:39:01 -0800 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.144]) by IRSMSX152.ger.corp.intel.com ([169.254.6.56]) with mapi id 14.03.0195.001; Tue, 16 Dec 2014 18:39:00 +0000 From: "Ananyev, Konstantin" To: Jay Rolette , Dev Thread-Topic: [dpdk-dev] [PATCH] replaced O(n^2) sort in sort_by_physaddr() with qsort() from standard library Thread-Index: AQHQFVyU+firDJfMLkmDVfyF9iWdDpySk28g Date: Tue, 16 Dec 2014 18:39:00 +0000 Message-ID: <2601191342CEEE43887BDE71AB977258213C1357@IRSMSX105.ger.corp.intel.com> References: In-Reply-To: Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] replaced O(n^2) sort in sort_by_physaddr() with qsort() from standard library X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 19:35:54 -0000 DQpIaSBKYXksDQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogZGV2IFtt YWlsdG86ZGV2LWJvdW5jZXNAZH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